X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllMessages.php;h=244effc5238a3dacb235fb4d08a7ba16704e0998;hp=e0ba4ea1c19c27287c11470f20e854b9a54fa31b;hb=49748181dd56ec97e7ba7c13e684a16abceb3cc0;hpb=f7429252f85c5835b291def55fc04b8196c1bb39 diff --git a/includes/api/ApiQueryAllMessages.php b/includes/api/ApiQueryAllMessages.php index e0ba4ea1c1..244effc523 100644 --- a/includes/api/ApiQueryAllMessages.php +++ b/includes/api/ApiQueryAllMessages.php @@ -41,7 +41,9 @@ class ApiQueryAllMessages extends ApiQueryBase { if ( is_null( $params['lang'] ) ) { $langObj = $this->getLanguage(); } elseif ( !Language::isValidCode( $params['lang'] ) ) { - $this->dieUsage( 'Invalid language code for parameter lang', 'invalidlang' ); + $this->dieWithError( + [ 'apierror-invalidlang', $this->encodeParamName( 'lang' ) ], 'invalidlang' + ); } else { $langObj = Language::factory( $params['lang'] ); } @@ -50,7 +52,7 @@ class ApiQueryAllMessages extends ApiQueryBase { if ( !is_null( $params['title'] ) ) { $title = Title::newFromText( $params['title'] ); if ( !$title || $title->isExternal() ) { - $this->dieUsageMsg( [ 'invalidtitle', $params['title'] ] ); + $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $params['title'] ) ] ); } } else { $title = Title::newFromText( 'API' );