SF.net SVN: phpwiki:[10693] trunk/lib/WikiPlugin.php

vargenau--- via phpwiki-checkins <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 10693
          http://sourceforge.net/p/phpwiki/code/10693
Author:   vargenau
Date:     2021-11-25 17:50:47 +0000 (Thu, 25 Nov 2021)
Log Message:
-----------
Avoid warning in stristr

Modified Paths:
--------------
    trunk/lib/WikiPlugin.php

Modified: trunk/lib/WikiPlugin.php
===================================================================
--- trunk/lib/WikiPlugin.php	2021-11-25 16:56:58 UTC (rev 10692)
+++ trunk/lib/WikiPlugin.php	2021-11-25 17:50:47 UTC (rev 10693)
@@ -469,20 +469,13 @@
     {
         $arguments = HTML();
         foreach ($this->getDefaultArguments() as $arg => $default) {
-            // Work around UserPreferences plugin to avoid error
-            if ((is_array($default))) {
-                $default = '(array)';
-                // This is a bit flawed with UserPreferences object
-                //$default = sprintf("array('%s')",
-                //                   implode("', '", array_keys($default)));
-            } else
-                if (stristr($default, ' '))
-                    $default = "'$default'";
+            if (!empty($default) && stristr($default, ' ')) {
+                $default = "'$default'";
+            }
             $arguments->pushContent("$arg=$default", HTML::br());
         }
         return $arguments;
     }
-
 }
 
 class WikiPluginLoader

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.