SF.net SVN: phpwiki:[10721] trunk/lib/plugin/Transclude.php

vargenau--- via phpwiki-checkins <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 10721
          http://sourceforge.net/p/phpwiki/code/10721
Author:   vargenau
Date:     2021-12-02 11:29:09 +0000 (Thu, 02 Dec 2021)
Log Message:
-----------
Transclude plugin: test argument quiet is a boolean

Modified Paths:
--------------
    trunk/lib/plugin/Transclude.php

Modified: trunk/lib/plugin/Transclude.php
===================================================================
--- trunk/lib/plugin/Transclude.php	2021-12-02 11:09:30 UTC (rev 10720)
+++ trunk/lib/plugin/Transclude.php	2021-12-02 11:29:09 UTC (rev 10721)
@@ -74,9 +74,20 @@
         $args = ($this->getArgs($argstr, $request));
         extract($args);
 
-        if (!$src) {
+        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"));
+            }
+        }
+
+        if (empty($src)) {
             return $this->error(fmt("%s parameter missing", "'src'"));
         }
+
         // Expand possible interwiki link for src
         if (strstr($src, ':')
             and (!strstr($src, '://'))

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.