Replace $wgLegalTitleChars with Title::legalChars()

Bug: T297340
Change-Id: I0828f5d9f6e5c65435c489adab3e161ad1c67873
This commit is contained in:
Umherirrender 2021-12-09 15:49:31 +01:00
parent faf4237dd2
commit 9f9e40cf7a

View file

@ -12,6 +12,7 @@ use PermissionsError;
use ReadOnlyError;
use SpecialPage;
use Status;
use Title;
/**
* Implements Special:Interwiki
@ -244,8 +245,7 @@ class SpecialInterwiki extends SpecialPage {
// Invalid characters for a title should also be invalid for a prefix.
// Whitespace, ':', '&' and '=' are invalid, too.
// (Bug 30599).
global $wgLegalTitleChars;
$validPrefixChars = preg_replace( '/[ :&=]/', '', $wgLegalTitleChars );
$validPrefixChars = preg_replace( '/[ :&=]/', '', Title::legalChars() );
if ( $do === 'add' && preg_match( "/\s|[^$validPrefixChars]/", $prefix ) ) {
$status->fatal( 'interwiki-badprefix', htmlspecialchars( $prefix ) );
return $status;