Merge "Avoid directly using EditPage::$mTitle"

This commit is contained in:
jenkins-bot 2017-09-01 21:44:07 +00:00 committed by Gerrit Code Review
commit f0eb3a83c1

View file

@ -122,23 +122,24 @@ class SpamBlacklistHooks {
* Confirm that a local blacklist page being saved is valid, * Confirm that a local blacklist page being saved is valid,
* and toss back a warning to the user if it isn't. * and toss back a warning to the user if it isn't.
* *
* @param $editPage EditPage * @param EditPage $editPage
* @param $text string * @param string $text
* @param $section string * @param string $section
* @param $hookError string * @param string $hookError
* @return bool * @return bool
*/ */
static function validate( $editPage, $text, $section, &$hookError ) { static function validate( EditPage $editPage, $text, $section, &$hookError ) {
$thisPageName = $editPage->mTitle->getPrefixedDBkey(); $title = $editPage->getTitle();
$thisPageName = $title->getPrefixedDBkey();
if ( !BaseBlacklist::isLocalSource( $editPage->mTitle ) ) { if ( !BaseBlacklist::isLocalSource( $title ) ) {
wfDebugLog( 'SpamBlacklist', wfDebugLog( 'SpamBlacklist',
"Spam blacklist validator: [[$thisPageName]] not a local blacklist\n" "Spam blacklist validator: [[$thisPageName]] not a local blacklist\n"
); );
return true; return true;
} }
$type = BaseBlacklist::getTypeFromTitle( $editPage->mTitle ); $type = BaseBlacklist::getTypeFromTitle( $title );
if ( $type === false ) { if ( $type === false ) {
return true; return true;
} }