Check namespace exists in HTMLNamespacesMultiselectField validation
Bug: T219882 Change-Id: I710d0abed6bd40dcea5bdd1c59c8d936565961eb
This commit is contained in:
parent
de25a85a22
commit
83ebbb519f
1 changed files with 5 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Widget\NamespacesMultiselectWidget;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
||||
/**
|
||||
* Implements a tag multiselect input field for namespaces.
|
||||
|
|
@ -43,7 +44,10 @@ class HTMLNamespacesMultiselectField extends HTMLSelectNamespace {
|
|||
}
|
||||
|
||||
foreach ( $namespaces as $namespace ) {
|
||||
if ( $namespace < 0 ) {
|
||||
if (
|
||||
$namespace < 0 ||
|
||||
!MediaWikiServices::getInstance()->getNamespaceInfo()->exists( $namespace )
|
||||
) {
|
||||
return $this->msg( 'htmlform-select-badoption' );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue