From: Geoffrey T. D. <da...@us...> - 2003-02-26 00:39:34
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1:/tmp/cvs-serv29225/lib Modified Files: CachedMarkup.php InlineParser.php stdlib.php Log Message: Bug fix: for magic PhpWiki URLs, "lock page to enable link" message was being displayed at incorrect times. Index: CachedMarkup.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/CachedMarkup.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -2 -b -p -d -r1.3 -r1.4 --- CachedMarkup.php 26 Feb 2003 00:10:25 -0000 1.3 +++ CachedMarkup.php 26 Feb 2003 00:39:30 -0000 1.4 @@ -267,4 +267,22 @@ class Cached_WikiLinkIfKnown extends Cac } +class Cached_PhpwikiURL extends Cached_DynamicContent +{ + function Cached_PhpwikiURL ($url, $label) { + $this->_url = $url; + if ($label) + $this->_label = $label; + } + + function isInlineElement() { + return true; + } + + function expand($basepage) { + $label = isset($this->_label) ? $this->_label : false; + return LinkPhpwikiURL($this->_url, $label, $basepage); + } +} + class Cached_ExternalLink extends Cached_Link { Index: InlineParser.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/InlineParser.php,v retrieving revision 1.26 retrieving revision 1.27 diff -u -2 -b -p -d -r1.26 -r1.27 --- InlineParser.php 23 Feb 2003 22:43:35 -0000 1.26 +++ InlineParser.php 26 Feb 2003 00:39:30 -0000 1.27 @@ -299,5 +299,5 @@ function LinkBracketLink($bracketlink) { } elseif (preg_match("/^phpwiki:/", $link)) - return LinkPhpwikiURL($link, $label); + return new Cached_PhpwikiURL($link, $label); elseif (preg_match("/^" . $intermap->getRegexp() . ":/", $link)) return new Cached_InterwikiLink($link, $label); Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.143 retrieving revision 1.144 diff -u -2 -b -p -d -r1.143 -r1.144 --- stdlib.php 26 Feb 2003 00:10:26 -0000 1.143 +++ stdlib.php 26 Feb 2003 00:39:30 -0000 1.144 @@ -274,5 +274,5 @@ function SplitQueryArgs ($query_args = ' } -function LinkPhpwikiURL($url, $text = '') { +function LinkPhpwikiURL($url, $text = '', $basepage) { $args = array(); @@ -314,5 +314,6 @@ function LinkPhpwikiURL($url, $text = '' else { // Don't allow administrative links on unlocked pages. - $page = $GLOBALS['request']->getPage(); + $dbi = $GLOBALS['request']->getDbh(); + $page = $dbi->getPage($basepage); if (!$page->get('locked')) return HTML::span(array('class' => 'wikiunsafe'), @@ -1238,4 +1239,8 @@ class Alert { // $Log$ +// Revision 1.144 2003/02/26 00:39:30 dairiki +// Bug fix: for magic PhpWiki URLs, "lock page to enable link" message was +// being displayed at incorrect times. +// // Revision 1.143 2003/02/26 00:10:26 dairiki // More/better/different checks for bad page names. |