[Pmwiki-users] Re: custom wikistyle -- help?

Patrick R. Michaud pmichaud at pobox.com
Mon Jan 24 12:27:26 CST 2005


On Mon, Jan 24, 2005 at 01:19:16PM -0500, Bronwyn Boltwood wrote:
> ## [[text > target]] KEEP BEFORE titleof.php!
> ## based on [[text -> target]] from beta 19
> ## doesn't break built-in version, and copes with spaces or lack thereof
> Markup('[[->','>[[|',
>   "/(?>\\[\\[([^\\]]+?)\\s*-?+>\\s*)(\\S.+?)\\]\\]($SuffixPattern)/e",
>   "Keep(MakeLink(\$pagename,PSS('$2'),PSS('$1'),'$3'),'L')");
> 
> If this rule is commented out (which it often was while figuring out
> what kept breaking titleof.php), PmWiki dumps anything in config.php
> after the ?> in the above at the top of the page.  My custom wikistyle
> definition was after that rule.
> 
> It took me some time to figure out that text after the ?> probably
> weren't getting interpreted.  Now that I've debugged the titleof
> breakage, the rule is enabled again, and my custom wikistyle gets
> handled properly.

It's almost certainly a problem of a missing/misplaced doublequote  (")
somewhere in the code prior to this statement.  If you look carefully
at the lines

  Markup('[[->','>[[|',
    "/(?>\\[\\[([^\\]]+?)\\s*-?+>\\s*)(\\S.+?)\\]\\]($SuffixPattern)/e",
    "Keep(MakeLink(\$pagename,PSS('$2'),PSS('$1'),'$3'),'L')");

you'll see that there's a ?> sequence there.  PHP uses the ?> to indicate
the end of a script, except when the ?> occurs in a quoted string.  So, 
if there was a missing double-quote somewhere before these lines, then all
of the text up to the first double-quote of this string would be
considered part of the string from the previous lines.  The ?> would 
then be seen as unquoted, and PHP would treat it as an end-of-scripting
section and simply dump anything that followed (up to the next <?php or
end of file) out to the browser.

Pm



More information about the pmwiki-users mailing list