splitbrain / dokuwiki-plugin-dw2pdf

A fork of Luigi Micco's PDF export plugin for DokuWiki
http://www.dokuwiki.org/plugin:dw2pdf
55 stars 68 forks source link

Port numbers not supported in mpdf class #10

Open SantiPR opened 12 years ago

SantiPR commented 12 years ago

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.

- 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

   $root = $tr['scheme'].'://'.$tr['host'];  
+ if($tr['port']) $root .= ':'.$tr['port'];
splitbrain commented 12 years ago

You're right it is broken. I reported it upstream at http://www.mpdf1.com/mpdf/forum/comments.php?DiscussionID=802

Your changes alone seem not to work (but create an infinite loop). I think there's something wrong with how the function treats colons. I'll see to find a fix unless it gets fixed upstream.

SantiPR commented 12 years ago

Sorry, I'm absolute beginner in PHP. I'm not sure how this changes works for me. The page exported included some images and other visual plugins like note. All of the images in the pages are printed correctly.

If this could help to fix, my installation is in windows and the url is in form http://server:port/dokuwiki. I have configured my dokuwiki to use "/" instead of ":".

If it can help, I can provide some log info about the images that the page print.

PS: sorry for closed and reopen issue.

Klap-in commented 11 years ago

At the report referered above at the mpdf forum, someone report success for the second change that mentioned above. My understanding is that it fix usage of images. Is implemented by 3c8bf0423e

I haven't tested it...

Klap-in commented 10 years ago

discussion moved to http://www.mpdf1.com/forum/discussion/802

Klap-in commented 9 years ago

I have no test setup. So please test results are welcome!