From: <var...@us...> - 2009-08-19 19:35:36
|
Revision: 7070 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7070&view=rev Author: vargenau Date: 2009-08-19 19:35:29 +0000 (Wed, 19 Aug 2009) Log Message: ----------- Improve redirect handling: allow Wikicreole syntax for plugin, handle quotes around page name Modified Paths: -------------- trunk/lib/plugin/IncludePage.php Modified: trunk/lib/plugin/IncludePage.php =================================================================== --- trunk/lib/plugin/IncludePage.php 2009-08-19 19:31:06 UTC (rev 7069) +++ trunk/lib/plugin/IncludePage.php 2009-08-19 19:35:29 UTC (rev 7070) @@ -109,9 +109,16 @@ $c = $r->getContent(); // follow redirects - if (preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\w+)\s+\?'.'>/', + if ((preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\S+)\s*\?'.'>/', implode("\n", $c), $m)) + or (preg_match('/<<\s*RedirectTo\s+page=(\S+)\s*>>/', + implode("\n", $c), $m))) { + // Strip quotes (simple or double) from page name if any + if ((string_starts_with($m[1], "'")) + or (string_starts_with($m[1], "\""))) { + $m[1] = substr($m[1], 1, -1); + } // trap recursive redirects if (in_array($m[1], $included_pages)) { return $this->error(sprintf(_("recursive inclusion of page %s ignored"), @@ -122,7 +129,7 @@ $r = $p->getCurrentRevision(); $c = $r->getContent(); // array of lines } - + $ct = $this->extractParts ($c, $page, $args); // exclude from expansion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |