SF.net SVN: phpwiki:[10723] trunk/lib/plugin/UnfoldSubpages.php

vargenau--- via phpwiki-checkins <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.