From: <var...@us...> - 2009-11-21 15:02:24
|
Revision: 7275 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7275&view=rev Author: vargenau Date: 2009-11-21 15:02:06 +0000 (Sat, 21 Nov 2009) Log Message: ----------- Avoid "Undefined variable" notice Modified Paths: -------------- trunk/lib/plugin/UnfoldSubpages.php Modified: trunk/lib/plugin/UnfoldSubpages.php =================================================================== --- trunk/lib/plugin/UnfoldSubpages.php 2009-11-20 17:50:59 UTC (rev 7274) +++ trunk/lib/plugin/UnfoldSubpages.php 2009-11-21 15:02:06 UTC (rev 7275) @@ -170,7 +170,7 @@ false, $ct))); } } - if (! $cpagename ) { + if (! isset($cpagename)) { return $this->error(sprintf(_("%s has no subpages defined."), $pagename)); } return $content; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-11-21 15:18:39
|
Revision: 7276 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7276&view=rev Author: vargenau Date: 2009-11-21 15:18:27 +0000 (Sat, 21 Nov 2009) Log Message: ----------- Follow redirects even when page name contains spaces Modified Paths: -------------- trunk/lib/plugin/UnfoldSubpages.php Modified: trunk/lib/plugin/UnfoldSubpages.php =================================================================== --- trunk/lib/plugin/UnfoldSubpages.php 2009-11-21 15:02:06 UTC (rev 7275) +++ trunk/lib/plugin/UnfoldSubpages.php 2009-11-21 15:18:27 UTC (rev 7276) @@ -27,8 +27,6 @@ * The section extractor is currently quite unstable. * Usage: <?plugin UnfoldSubpages sortby=-mtime words=50 maxpages=5 ?> * Author: Reini Urban <ru...@x-...> - * - * Todo: follow RedirectTo */ require_once("lib/PageList.php"); @@ -120,9 +118,16 @@ $r = $page->getCurrentRevision(); $c = $r->getContent(); // array of lines // follow redirects - if (preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\w+)\s+\?'.'>/', - implode("\n", $c), $m)) + if ((preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\S+)\s*\?'.'>/', implode("\n", $c), $m)) + or (preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(.*?)\s*\?'.'>/', implode("\n", $c), $m)) + or (preg_match('/<<\s*RedirectTo\s+page=(\S+)\s*>>/', implode("\n", $c), $m)) + or (preg_match('/<<\s*RedirectTo\s+page="(.*?)"\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)) { if (!$quiet) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-22 17:04:05
|
Revision: 9767 http://sourceforge.net/p/phpwiki/code/9767 Author: vargenau Date: 2016-01-22 17:04:02 +0000 (Fri, 22 Jan 2016) Log Message: ----------- Comments only Modified Paths: -------------- trunk/lib/plugin/UnfoldSubpages.php Modified: trunk/lib/plugin/UnfoldSubpages.php =================================================================== --- trunk/lib/plugin/UnfoldSubpages.php 2016-01-18 10:17:01 UTC (rev 9766) +++ trunk/lib/plugin/UnfoldSubpages.php 2016-01-22 17:04:02 UTC (rev 9767) @@ -48,23 +48,17 @@ PageList::supportedArgs(), array( 'pagename' => '[pagename]', // default: current page - //'header' => '', // expandable string 'quiet' => false, // print no header 'sortby' => '', // [+|-]pagename, [+|-]mtime, [+|-]hits 'maxpages' => false, // maximum number of pages to include (== limit) - 'smalltitle' => false, // if set, hide transclusion-title, - // just have a small link at the start of - // the page. - 'words' => false, // maximum number of words - // per page to include - 'lines' => false, // maximum number of lines - // per page to include - 'bytes' => false, // maximum number of bytes - // per page to include + 'smalltitle' => false, // if set, hide transclusion-title, + // just have a small link at the start of the page. + 'words' => false, // maximum number of words per page to include + 'lines' => false, // maximum number of lines per page to include + 'bytes' => false, // maximum number of bytes per page to include 'sections' => false, // maximum number of sections per page to include 'section' => false, // this named section per page only - 'sectionhead' => false // when including a named - // section show the heading + 'sectionhead' => false // when including a named section show the heading )); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-12-02 11:40:18
|
Revision: 10723 http://sourceforge.net/p/phpwiki/code/10723 Author: vargenau Date: 2021-12-02 11:40:16 +0000 (Thu, 02 Dec 2021) Log Message: ----------- UnfoldSubpages plugin: test argument quiet is a boolean Modified Paths: -------------- trunk/lib/plugin/UnfoldSubpages.php Modified: trunk/lib/plugin/UnfoldSubpages.php =================================================================== --- trunk/lib/plugin/UnfoldSubpages.php 2021-12-02 11:32:19 UTC (rev 10722) +++ trunk/lib/plugin/UnfoldSubpages.php 2021-12-02 11:40:16 UTC (rev 10723) @@ -78,6 +78,17 @@ $args = $this->getArgs($argstr, $request); extract($args); + + if (!is_bool($quiet)) { + if (($quiet == '0') || ($quiet == 'false')) { + $quiet = false; + } elseif (($quiet == '1') || ($quiet == 'true')) { + $quiet = true; + } else { + return $this->error(sprintf(_("Argument '%s' must be a boolean"), "quiet")); + } + } + $query = new TextSearchQuery($pagename . '/' . '*', true, 'glob'); $subpages = $dbi->titleSearch($query, $sortby, $limit, $exclude); if (is_string($exclude) and !is_array($exclude)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |