mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
synced 2024-11-30 18:04:24 +00:00
Merge "Avoid directly using EditPage::$mTitle"
This commit is contained in:
commit
f0eb3a83c1
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue