X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fhtmlform%2Ffields%2FHTMLTitleTextField.php;h=dd9f793e1f6107d58b8db81fb5b5e1fb12fc2d95;hp=0ad41d43bd267dfd19d647a2e808b7883a18bab2;hb=1dee28cb5f1efd6d9e14d6cc1d0c73c3f69269b4;hpb=2b9391c966ed6ae8780153c25e684a3cb44ee46a diff --git a/includes/htmlform/fields/HTMLTitleTextField.php b/includes/htmlform/fields/HTMLTitleTextField.php index 0ad41d43bd..dd9f793e1f 100644 --- a/includes/htmlform/fields/HTMLTitleTextField.php +++ b/includes/htmlform/fields/HTMLTitleTextField.php @@ -56,17 +56,10 @@ class HTMLTitleTextField extends HTMLTextField { $title = Title::newFromTextThrow( $value ); } else { // Can't use Title::makeTitleSafe(), because it doesn't throw useful exceptions - global $wgContLang; - $namespaceName = $wgContLang->getNsText( $this->mParams['namespace'] ); - $title = Title::newFromTextThrow( $namespaceName . ':' . $value ); + $title = Title::newFromTextThrow( Title::makeName( $this->mParams['namespace'], $value ) ); } } catch ( MalformedTitleException $e ) { - $msg = $this->msg( $e->getErrorMessage() ); - $params = $e->getErrorMessageParameters(); - if ( $params ) { - $msg->params( $params ); - } - return $msg; + return $this->msg( $e->getErrorMessage(), $e->getErrorMessageParameters() ); } $text = $title->getPrefixedText();