SF.net SVN: phpwiki:[10759] trunk/lib/plugin/WikiAdminSetExternal.php

vargenau--- via phpwiki-checkins <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 10759
          http://sourceforge.net/p/phpwiki/code/10759
Author:   vargenau
Date:     2021-12-09 16:52:08 +0000 (Thu, 09 Dec 2021)
Log Message:
-----------
WikiAdminSetExternal plugin: avoid warning

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

Modified: trunk/lib/plugin/WikiAdminSetExternal.php
===================================================================
--- trunk/lib/plugin/WikiAdminSetExternal.php	2021-12-09 14:34:19 UTC (rev 10758)
+++ trunk/lib/plugin/WikiAdminSetExternal.php	2021-12-09 16:52:08 UTC (rev 10759)
@@ -51,7 +51,7 @@
             ));
     }
 
-    private function setExternalPages(&$dbi, &$request, $pages)
+    private function setExternalPages($dbi, $pages)
     {
         $result = HTML::div();
         $ul = HTML::ul();
@@ -68,7 +68,7 @@
                     $result->pushContent(HTML::p(fmt("Access denied to change page “%s”.",
                         WikiLink($name))));
                 } else {
-                    $page->set('external', (bool)1);
+                    $page->set('external', true);
                     $ul->pushContent(HTML::li(fmt("change page “%s” to external.", WikiLink($name))));
                     $count++;
                 }
@@ -83,12 +83,11 @@
                 $result->pushContent(HTML::p(fmt("%d pages have been changed:", $count)));
             }
             $result->pushContent($ul);
-            return $result;
         } else {
             $result->setAttr('class', 'error');
             $result->pushContent(HTML::p(_("No pages changed.")));
-            return $result;
         }
+        return $result;
     }
 
     /**
@@ -113,6 +112,9 @@
         $p = $request->getArg('p');
         if (!$p) $p = $this->_list;
         $post_args = $request->getArg('admin_external');
+        if ($post_args === false) {
+            $post_args = array();
+        }
         if (!$request->isPost() and empty($post_args['external']))
             $post_args['external'] = $args['external'];
         $pages = array();
@@ -127,7 +129,7 @@
                 $this->disabled("! user->isAdmin");
             }
             // Real action
-            return $this->setExternalPages($dbi, $request, array_keys($p));
+            return $this->setExternalPages($dbi, array_keys($p));
         }
         $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']);
         $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args);

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



_______________________________________________
phpwiki-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpwiki-checkins
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.