From: <var...@us...> - 2014-09-24 16:13:42
|
Revision: 9111 http://sourceforge.net/p/phpwiki/code/9111 Author: vargenau Date: 2014-09-24 16:13:38 +0000 (Wed, 24 Sep 2014) Log Message: ----------- Fix #607 BackLinks do not work inside a RichTable; fix Bug#636 Recursive include is not trapped Modified Paths: -------------- trunk/lib/InlineParser.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/MediawikiTable.php trunk/lib/plugin/OldStyleTable.php trunk/lib/plugin/RichTable.php trunk/lib/plugin/Template.php trunk/lib/plugin/WikicreoleTable.php trunk/pgsrc/ReleaseNotes Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/lib/InlineParser.php 2014-09-24 16:13:38 UTC (rev 9111) @@ -513,6 +513,10 @@ $pagename = $link; $anchor = false; } + + global $backlinks; + $backlinks[] = array('linkto' => $pagename, 'relation' => 0); + return new Cached_WikiLink($pagename, $label, $anchor); } } Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/lib/WikiDB/backend/PearDB.php 2014-09-24 16:13:38 UTC (rev 9111) @@ -1161,7 +1161,7 @@ * ErrorManager which will filter out those spurious messages.) * @see _is_false_error, ErrorManager */ - private function _pear_notice_filter($err) + function _pear_notice_filter($err) { return ($err->isNotice() && preg_match('|DB[/\\\\]common.php$|', $err->errfile) Modified: trunk/lib/plugin/IncludePage.php =================================================================== --- trunk/lib/plugin/IncludePage.php 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/lib/plugin/IncludePage.php 2014-09-24 16:13:38 UTC (rev 9111) @@ -61,7 +61,15 @@ } if (!$page or !$page->name) return false; - return array(array('linkto' => $page->name, 'relation' => 0)); + + global $backlinks; + if (empty($backlinks)) { + global $request; + $this->run($request->_dbi, $argstr, $request, $basepage); + } + + $backlinks[] = array('linkto' => $page->name, 'relation' => 0); + return $backlinks; } // Avoid warning in: Modified: trunk/lib/plugin/MediawikiTable.php =================================================================== --- trunk/lib/plugin/MediawikiTable.php 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/lib/plugin/MediawikiTable.php 2014-09-24 16:13:38 UTC (rev 9111) @@ -62,8 +62,22 @@ return array(); } + function getWikiPageLinks($argstr, $basepage) + { + global $backlinks; + if (empty($backlinks)) { + global $request; + $this->run($request->_dbi, $argstr, $request, $basepage); + } + return $backlinks; + } + function run($dbi, $argstr, &$request, $basepage) { + global $backlinks; + + $backlinks = array(); + include_once 'lib/BlockParser.php'; // We allow the compact Mediawiki syntax with: Modified: trunk/lib/plugin/OldStyleTable.php =================================================================== --- trunk/lib/plugin/OldStyleTable.php 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/lib/plugin/OldStyleTable.php 2014-09-24 16:13:38 UTC (rev 9111) @@ -66,8 +66,22 @@ return; } + function getWikiPageLinks($argstr, $basepage) + { + global $backlinks; + if (empty($backlinks)) { + global $request; + $this->run($request->_dbi, $argstr, $request, $basepage); + } + return $backlinks; + } + function run($dbi, $argstr, &$request, $basepage) { + global $backlinks; + + $backlinks = array(); + include_once 'lib/InlineParser.php'; $args = $this->getArgs($argstr, $request); Modified: trunk/lib/plugin/RichTable.php =================================================================== --- trunk/lib/plugin/RichTable.php 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/lib/plugin/RichTable.php 2014-09-24 16:13:38 UTC (rev 9111) @@ -40,8 +40,22 @@ return array(); } + function getWikiPageLinks($argstr, $basepage) + { + global $backlinks; + if (empty($backlinks)) { + global $request; + $this->run($request->_dbi, $argstr, $request, $basepage); + } + return $backlinks; + } + function run($dbi, $argstr, &$request, $basepage) { + global $backlinks; + + $backlinks = array(); + include_once 'lib/BlockParser.php'; $lines = preg_split('/\n/', $argstr); Modified: trunk/lib/plugin/Template.php =================================================================== --- trunk/lib/plugin/Template.php 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/lib/plugin/Template.php 2014-09-24 16:13:38 UTC (rev 9111) @@ -91,7 +91,15 @@ } if (!$page or !$page->name) return false; - return array(array('linkto' => $page->name, 'relation' => 0)); + + global $backlinks; + if (empty($backlinks)) { + global $request; + $this->run($request->_dbi, $argstr, $request, $basepage); + } + + $backlinks[] = array('linkto' => $page->name, 'relation' => 0); + return $backlinks; } function run($dbi, $argstr, &$request, $basepage) Modified: trunk/lib/plugin/WikicreoleTable.php =================================================================== --- trunk/lib/plugin/WikicreoleTable.php 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/lib/plugin/WikicreoleTable.php 2014-09-24 16:13:38 UTC (rev 9111) @@ -66,8 +66,22 @@ return; } + function getWikiPageLinks($argstr, $basepage) + { + global $backlinks; + if (empty($backlinks)) { + global $request; + $this->run($request->_dbi, $argstr, $request, $basepage); + } + return $backlinks; + } + function run($dbi, $argstr, &$request, $basepage) { + global $backlinks; + + $backlinks = array(); + include_once 'lib/InlineParser.php'; $table = array(); Modified: trunk/pgsrc/ReleaseNotes =================================================================== --- trunk/pgsrc/ReleaseNotes 2014-09-24 15:56:32 UTC (rev 9110) +++ trunk/pgsrc/ReleaseNotes 2014-09-24 16:13:38 UTC (rev 9111) @@ -1,4 +1,4 @@ -Date: Thu, 18 Sep 2014 15:38:21 +0000 +Date: Wed, 24 Sep 2014 18:11:57 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.5.0) Content-Type: application/x-phpwiki; pagename=ReleaseNotes; @@ -16,6 +16,7 @@ * fix Bug#636 Recursive include is not trapped * fix Bug#647 undefined method WikiDB_backend_dba::WikiDB_backend_dbaBase * correct total number of pages for AllPagesCreatedByMe, AllPagesOwnedByMe, AllPagesLastEditedByMe +* fix Bug#607 BackLinks do not work inside a RichTable == 1.5.0 2014-07-29 Marc-Etienne Vargenau == This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |