From 61405c6373d1f1ee7e1c217a3a8faad25697c573 Mon Sep 17 00:00:00 2001 From: Nick Jenkins Date: Wed, 11 Jul 2007 08:43:21 +0000 Subject: [PATCH] (bug 10332) Title->userCan( 'edit' ) may return false positive (If this is not convenient for the userCan refactoring, then please revert this and reopen the bug) --- RELEASE-NOTES | 1 + includes/Title.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 01ef77ef10..dd62f75b62 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -276,6 +276,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 9903) Don't mark redirects in categories as stubs * (bug 6965) Cannot include "Template:R" with {{R}} (magic word conflict) * Padding parser functions now work with strings like '0' that evaluate to false +* (bug 10332) Title->userCan( 'edit' ) may return false positive == API changes since 1.10 == diff --git a/includes/Title.php b/includes/Title.php index 2d29e074dd..fa02564c18 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1103,6 +1103,11 @@ class Title { } } + if( $action == 'edit' && !$wgUser->isAllowed( 'edit' ) ) { + wfProfileOut( $fname ); + return false; + } + wfProfileOut( $fname ); return true; } -- 2.20.1