mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Merge "Phan wasn't checking the editcheck includes"
This commit is contained in:
commit
9690972d22
|
@ -6,6 +6,7 @@ $cfg['directory_list'] = array_merge(
|
|||
$cfg['directory_list'],
|
||||
[
|
||||
'../../extensions/BetaFeatures',
|
||||
'editcheck/includes',
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -12,11 +12,13 @@ use Wikimedia\ParamValidator\ParamValidator;
|
|||
|
||||
class ApiEditCheckReferenceUrl extends ApiBase {
|
||||
|
||||
/** @phan-suppress-next-line PhanUndeclaredTypeProperty */
|
||||
private ?BlockedDomainStorage $blockedDomainStorage;
|
||||
|
||||
public function __construct(
|
||||
ApiMain $main,
|
||||
string $name,
|
||||
// @phan-suppress-next-line PhanUndeclaredTypeParameter
|
||||
?BlockedDomainStorage $blockedDomainStorage
|
||||
) {
|
||||
parent::__construct( $main, $name );
|
||||
|
@ -46,7 +48,9 @@ class ApiEditCheckReferenceUrl extends ApiBase {
|
|||
return false;
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanUndeclaredClassMethod
|
||||
$domain = $this->blockedDomainStorage->validateDomain( $url );
|
||||
// @phan-suppress-next-line PhanUndeclaredClassMethod
|
||||
$blockedDomains = $this->blockedDomainStorage->loadComputed();
|
||||
return !empty( $blockedDomains[ $domain ] );
|
||||
}
|
||||
|
@ -60,6 +64,7 @@ class ApiEditCheckReferenceUrl extends ApiBase {
|
|||
$url = 'https://' . $url;
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanUndeclaredClassMethod
|
||||
$matches = BaseBlacklist::getSpamBlacklist()->filter(
|
||||
[ $url ],
|
||||
null,
|
||||
|
|
Loading…
Reference in a new issue