Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#98 PhantomBackLink bug

Linking
closed
nobody
5
2014-07-29
2002-02-18
Lawrence Akka
No

Applies to cvs as at 18 Feb 2002 - new markup problem

1) Create a page called NoLinkHere, and enter some
content on it

2) Create another page called PhantomBackLinkBug.
On the page create some content, including the text
~NoLinkHere

3) When rendered with the NewMarkup, the
PhantomBackLinkBug page will display no links.

4) Go to NoLinkHere, and check its BackLinks. The
Bug is revealed!

The bug is in the function ExtractWikiPageLinks
($content) in stdlib.php. Towards the end of the
function, links are matched in the line

if (preg_match_all("/!?$WikiNameRegexp/", $line,
$link)) ....

Clearly, this applies to old markup only.

However, the fix is non-trivial. Changing the ! to ~
will not work with old markup. We could just pass a
parameter to detect whether the markup in use is old
or new, and parse accordingly, but it seems to me
that the best fix would be to rewrite the code so
that the transformation engine itself could extract,
rather than just replace, links.

Until then, I thought I'd better log this on SF

Lawrence

Discussion

  • Logged In: YES
    user_id=45814

    The fix, which is in progess, is to use the (new) markup
    parser to extract the links. Using a whole separate parser
    to extract the links is just a bad idea.

     
  • Closing very old bugs.

     
    • status: open --> closed