From: Rotem Liss Date: Sat, 1 Jul 2006 10:54:31 +0000 (+0000) Subject: Fixing a wrongly-used private function (Title::userCan). X-Git-Tag: 1.31.0-rc.0~56499 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=08d29e055d4be3e38c87a1f9bd5b2a7ea9f8d50b;p=lhc%2Fweb%2Fwiklou.git Fixing a wrongly-used private function (Title::userCan). --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 37f8a99ebf..2ffda77fc9 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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 ); diff --git a/includes/Title.php b/includes/Title.php index da0e589034..535b07674a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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