Non-static method PagePermission::accessTypes() cannot be called statically

Christof Meerwald via Phpwiki-talk <[email protected]> Fri, 12 Jan 2024 16:52:58 +0100
Newsgroups gmane.comp.web.wiki.phpwiki.talk
Message-ID <[email protected]>
--PFWfdm4DyL5rc/VL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

attached a patch to make defaultPerms and accessTypes static so they
can be called from (static) dotPerms.

Can be triggered by opening a page whose name starts with a "."


Christof

-- 

https://cmeerw.org                             sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org                   xmpp:cmeerw at cmeerw.org

--PFWfdm4DyL5rc/VL
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="pageperm.diff"

Index: lib/PagePerm.php
===================================================================
--- lib/PagePerm.php	(revision 11069)
+++ lib/PagePerm.php	(working copy)
@@ -392,7 +395,7 @@
             }
         } else {
             // set default permissions, the so called dot-file acl's
-            $this->perm = $this->defaultPerms();
+            $this->perm = PagePermission::defaultPerms();
         }
         return $this;
     }
@@ -488,7 +491,7 @@
      * returns hash of default permissions.
      * check if the page '.' exists and returns this instead.
      */
-    public function defaultPerms()
+    public static function defaultPerms()
     {
         //Todo: check for the existance of '.' and take this instead.
         //Todo: honor more config.ini auth settings here
@@ -566,7 +569,7 @@
     /**
      * returns list of all supported access types.
      */
-    public function accessTypes()
+    public static function accessTypes()
     {
         return array_keys(PagePermission::defaultPerms());
     }

--PFWfdm4DyL5rc/VL
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--PFWfdm4DyL5rc/VL
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Phpwiki-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpwiki-talk

--PFWfdm4DyL5rc/VL--