Fixing a wrongly-used private function (Title::userCan).
authorRotem Liss <rotem@users.mediawiki.org>
Sat, 1 Jul 2006 10:54:31 +0000 (10:54 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Sat, 1 Jul 2006 10:54:31 +0000 (10:54 +0000)
includes/EditPage.php
includes/Title.php

index 37f8a99..2ffda77 100644 (file)
@@ -217,7 +217,7 @@ class EditPage {
                        wfProfileOut($fname);
                        return;
                }
-               if ( !$this->mTitle->userCan( 'create' ) && !$this->mTitle->exists() ) {
+               if ( !$this->mTitle->userCanCreate() && !$this->mTitle->exists() ) {
                        wfDebug( "$fname: no create permission\n" );
                        $this->noCreatePermission();
                        wfProfileOut( $fname );
@@ -567,7 +567,7 @@ class EditPage {
                $aid = $this->mTitle->getArticleID( GAID_FOR_UPDATE );
                if ( 0 == $aid ) {
                        // Late check for create permission, just in case *PARANOIA*
-                       if ( !$this->mTitle->userCan( 'create' ) ) {
+                       if ( !$this->mTitle->userCanCreate() ) {
                                wfDebug( "$fname: no create permission\n" );
                                $this->noCreatePermission();
                                wfProfileOut( $fname );
index da0e589..535b076 100644 (file)
@@ -1092,6 +1092,15 @@ class Title {
                return $this->userCan('edit');
        }
 
+       /**
+        * Can $wgUser create this page?
+        * @return boolean
+        * @access public
+        */
+       function userCanCreate() {
+               return $this->userCan('create');
+       }
+
        /**
         * Can $wgUser move this page?
         * @return boolean