X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fhtmlform%2Ffields%2FHTMLTitleTextField.php;h=3df5b7ec9ba19bf51cfa1e5257c9adb7dcf51402;hb=a5230acd936b5b9270037c35b9d2d419f4c8d9a6;hp=dd9f793e1f6107d58b8db81fb5b5e1fb12fc2d95;hpb=ef44b9075c0e2746ec2df0aaefa0ae9b9174d2fa;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/fields/HTMLTitleTextField.php b/includes/htmlform/fields/HTMLTitleTextField.php index dd9f793e1f..3df5b7ec9b 100644 --- a/includes/htmlform/fields/HTMLTitleTextField.php +++ b/includes/htmlform/fields/HTMLTitleTextField.php @@ -7,9 +7,6 @@ use MediaWiki\Widget\TitleInputWidget; * Automatically does validation that the title is valid, * as well as autocompletion if using the OOUI display format. * - * Note: Forms using GET requests will need to make sure the title value is not - * an empty string. - * * Optional parameters: * 'namespace' - Namespace the page must be in * 'relative' - If true and 'namespace' given, strip/add the namespace from/to the title as needed @@ -33,14 +30,6 @@ class HTMLTitleTextField extends HTMLTextField { } public function validate( $value, $alldata ) { - if ( $this->mParent->getMethod() === 'get' && $value === '' ) { - // If the form is a GET form and has no value, assume it hasn't been - // submitted yet, and skip validation - // TODO This doesn't look right, we should be able to tell the difference - // between "not submitted" (null) and "submitted but empty" (empty string). - return parent::validate( $value, $alldata ); - } - // Default value (from getDefault()) is null, which breaks Title::newFromTextThrow() below if ( $value === null ) { $value = ''; @@ -66,7 +55,7 @@ class HTMLTitleTextField extends HTMLTextField { if ( $this->mParams['namespace'] !== false && !$title->inNamespace( $this->mParams['namespace'] ) ) { - return $this->msg( 'htmlform-title-badnamespace', $this->mParams['namespace'], $text ); + return $this->msg( 'htmlform-title-badnamespace', $text, $this->mParams['namespace'] ); } if ( $this->mParams['creatable'] && !$title->canExist() ) {