X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryLogEvents.php;h=df8a11ee8bcab247b4808a44326013685b64ecf1;hb=9f2b48a970645f3a0a6b319e5c131e2b0bd1b259;hp=122594d1753f7c43ff4066cdedc3ff193c70573c;hpb=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 122594d175..df8a11ee8b 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -121,10 +121,10 @@ class ApiQueryLogEvents extends ApiQueryBase { } if ( !$valid ) { - $valueName = $this->encodeParamName( 'action' ); - $this->dieUsage( - "Unrecognized value for parameter '$valueName': {$logAction}", - "unknown_$valueName" + $encParamName = $this->encodeParamName( 'action' ); + $this->dieWithError( + [ 'apierror-unrecognizedvalue', $encParamName, wfEscapeWikiText( $logAction ) ], + "unknown_$encParamName" ); } @@ -173,7 +173,7 @@ class ApiQueryLogEvents extends ApiQueryBase { if ( !is_null( $title ) ) { $titleObj = Title::newFromText( $title ); if ( is_null( $titleObj ) ) { - $this->dieUsage( "Bad title value '$title'", 'param_title' ); + $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $title ) ] ); } $this->addWhereFld( 'log_namespace', $titleObj->getNamespace() ); $this->addWhereFld( 'log_title', $titleObj->getDBkey() ); @@ -187,18 +187,18 @@ class ApiQueryLogEvents extends ApiQueryBase { if ( !is_null( $prefix ) ) { if ( $this->getConfig()->get( 'MiserMode' ) ) { - $this->dieUsage( 'Prefix search disabled in Miser Mode', 'prefixsearchdisabled' ); + $this->dieWithError( 'apierror-prefixsearchdisabled' ); } $title = Title::newFromText( $prefix ); if ( is_null( $title ) ) { - $this->dieUsage( "Bad title value '$prefix'", 'param_prefix' ); + $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $prefix ) ] ); } $this->addWhereFld( 'log_namespace', $title->getNamespace() ); $this->addWhere( 'log_title ' . $db->buildLike( $title->getDBkey(), $db->anyString() ) ); } - // Paranoia: avoid brute force searches (bug 17342) + // Paranoia: avoid brute force searches (T19342) if ( $params['namespace'] !== null || !is_null( $title ) || !is_null( $user ) ) { if ( !$this->getUser()->isAllowed( 'deletedhistory' ) ) { $titleBits = LogPage::DELETED_ACTION; @@ -435,7 +435,8 @@ class ApiQueryLogEvents extends ApiQueryBase { ], 'title' => null, 'namespace' => [ - ApiBase::PARAM_TYPE => 'namespace' + ApiBase::PARAM_TYPE => 'namespace', + ApiBase::PARAM_EXTRA_NAMESPACES => [ NS_MEDIA, NS_SPECIAL ], ], 'prefix' => [], 'tag' => null, @@ -466,6 +467,6 @@ class ApiQueryLogEvents extends ApiQueryBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Logevents'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Logevents'; } }