From: Geoffrey T. D. <da...@us...> - 2001-08-18 01:50:50
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv20005/lib Modified Files: Tag: release-1_2-branch stdlib.php Log Message: Fixed SF Bug #414789 URLs like http://a.com/WikiWord were getting recognized as WikiWords by ExtractWikiPageLinks, therefore resulting in erroneous entries in the links table of those backends which have one. Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.21.2.4 retrieving revision 1.21.2.5 diff -C2 -r1.21.2.4 -r1.21.2.5 *** stdlib.php 2001/08/18 01:30:56 1.21.2.4 --- stdlib.php 2001/08/18 01:50:47 1.21.2.5 *************** *** 341,345 **** function ExtractWikiPageLinks($content) { ! global $WikiNameRegexp; $wikilinks = array(); --- 341,345 ---- function ExtractWikiPageLinks($content) { ! global $WikiNameRegexp, $AllowedProtocols; $wikilinks = array(); *************** *** 361,364 **** --- 361,368 ---- } + // Remove URLs (think about "http:a.b.com/WikiWords"). + $line = preg_replace("/!?\b($AllowedProtocols):[^\s<>\[\]\"'()]*[^\s<>\[\]\"'(),.?]/", + ' ', $line); + // BumpyText old-style wiki links if (preg_match_all("/!?$WikiNameRegexp/", $line, $link)) { |