On 28/04/14 6:35 PM, Petko Yotov wrote:
John Rankin writes:
One more piece of information: removing the ?> from the end of the backup script makes no difference -- still getting a blank line at the start of the page source.

Your messages seem to indicate that when the wiki loads either includeurl.php, or backup_pages.php, or both, there is exatcly one, not two, blank line ("\n") at the top of the HTML output, but when both recipes are commented out and not loaded, there is no blank line(s).

Can you confirm this?
Almost. If either recipe is loaded, there is one blank line. If both are loaded there are 2 blank lines. Using a regular expression match test, the blank lines match "\n".

If yes, I'd check if this is not some Byte Order Mark (BOM), ie. files were modified with a text editor and saved in "UTF-8 encoding with BOM", while they should be saved "without BOM" in a text editor which allows this.
I asked my user to run a wiki page against the W3C html validator and it doesn't return any validation errors. However, I don't know for sure if presence of a BOM constitutes an html validation error.

I'll ask him to try saving the files without BOM and see what happens. We have found a work-around that fixes the problem for PublishPDF that works for this particular use case, but it is not a general solution, so it would be good to get to the bottom of this.

There is an example at http://metastudies.net/pmwiki/pmwiki.php?n=Site.USPatent146407 -- using View Page Source shows 2 blank lines at the start of the html.

If no, I'd check any and all files in the pmwiki/local and pmwiki/cookbook directories for a closing "?>" marker and for a BOM. And all files that the person may have modified in the pmwiki/scripts directory.

A BOM for UTF-8 contains 3 characters "\xEF\xBB\xBF". If you don't use a compatible text editor, they may appear as weird characters, space(s) or may be hidden/invisible - not exactly a new line, but may break some parsers.

I tested the two recipes with both PHP 5.3 and 5.5 and I only get a blank line with backup_pages.php before I remove the "?>" tag.
Yes, I can't replicate the error either, which makes it hard to diagnose.

Petko

Thanks
JR

--
John Rankin


_______________________________________________
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to