splitbrain/dokuwiki-plugin-dw2pdf — Issue #10: Bug in mpdf class. Function GetFullPath.
Author: SantiPR
Created: 2012-01-27 10:05:35+00:00
State: open

When you try to print a wiki page with embedded images, if the url site is like "http://host:port", the function **GetFullPath** don't process paths correctly.

I thought that there is an error in for loop, because it is processing over _$path_ var but I presume that must be over _$filepath_ var.

``` php
- for( $i = 0 ; $i < $backtrackamount + 1 ; $i++ ) $path = substr( $path, 0 , strrpos($path,"/") );
+ for( $i = 0 ; $i < $backtrackamount + 1 ; $i++ ) $filepath = substr( $filepath, 0 , strrpos($filepath,"/") );
```

Another error is when process local link. When _$root_ var is beeing build, the _port_ isný having in account to build the url

``` php
$root = $tr['scheme'].'://'.$tr['host'];
+ if($tr['port']) $root .= ':'.$tr['port'];
```