From 08d29e055d4be3e38c87a1f9bd5b2a7ea9f8d50b Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Sat, 1 Jul 2006 10:54:31 +0000 Subject: [PATCH] Fixing a wrongly-used private function (Title::userCan). --- includes/EditPage.php | 4 ++-- includes/Title.php | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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 -- 2.20.1