|
From: <var...@us...> - 2021-10-01 13:38:09
|
Revision: 10609
http://sourceforge.net/p/phpwiki/code/10609
Author: vargenau
Date: 2021-10-01 13:38:08 +0000 (Fri, 01 Oct 2021)
Log Message:
-----------
lib/plugin/LikePages.php: prefix and suffix are strings; test noheader
Modified Paths:
--------------
trunk/lib/plugin/LikePages.php
trunk/pgsrc/Help%2FLikePagesPlugin
Modified: trunk/lib/plugin/LikePages.php
===================================================================
--- trunk/lib/plugin/LikePages.php 2021-09-30 16:00:00 UTC (rev 10608)
+++ trunk/lib/plugin/LikePages.php 2021-10-01 13:38:08 UTC (rev 10609)
@@ -40,8 +40,8 @@
(
PageList::supportedArgs(),
array('page' => '[pagename]',
- 'prefix' => false,
- 'suffix' => false,
+ 'prefix' => '',
+ 'suffix' => '',
'noheader' => false,
));
}
@@ -65,6 +65,16 @@
if (empty($page) && empty($prefix) && empty($suffix))
return '';
+ if (!is_bool($noheader)) {
+ if (($noheader == '0') || ($noheader == 'false')) {
+ $noheader = false;
+ } elseif (($noheader == '1') || ($noheader == 'true')) {
+ $noheader = true;
+ } else {
+ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noheader"));
+ }
+ }
+
if ($prefix) {
$suffix = false;
$descrip = fmt("Page names with prefix “%s”", $prefix);
@@ -101,8 +111,9 @@
$match_re = '/' . join('|', $match) . '/';
$pagelist = new PageList($info, $exclude, $args);
- if (!$noheader)
+ if (!$noheader) {
$pagelist->setCaption($descrip);
+ }
$pages = $dbi->titleSearch($query);
while ($page = $pages->next()) {
$name = $page->getName();
Modified: trunk/pgsrc/Help%2FLikePagesPlugin
===================================================================
--- trunk/pgsrc/Help%2FLikePagesPlugin 2021-09-30 16:00:00 UTC (rev 10608)
+++ trunk/pgsrc/Help%2FLikePagesPlugin 2021-10-01 13:38:08 UTC (rev 10609)
@@ -1,4 +1,4 @@
-Date: Thu, 13 Oct 2016 15:09:28 +0000
+Date: Fri, 1 Oct 2021 15:22:19 +0000
Mime-Version: 1.0 (Produced by PhpWiki 1.6.0)
Content-Type: application/x-phpwiki;
pagename=Help%2FLikePagesPlugin;
@@ -30,11 +30,11 @@
|-
| **prefix**
| List only pages that share the same prefix
-| false
+| //empty string//
|-
| **suffix**
| List only pages that share the same suffix
-| false
+| //empty string//
|}
== Examples ==
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|