X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiBase.php;h=c03faf05135d0eca3cfd4e794bd072f4df8359fd;hb=9012dfe523854a125e781d6fb7d255431615d95a;hp=b8dd4641d900ac1831db8cfcb120e40fe048a993;hpb=e5e91cb0fa2c9d96c6ccac00d3d0c4760b2bccb1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index b8dd4641d9..c03faf0513 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -700,7 +700,7 @@ abstract class ApiBase extends ContextSource { * @return array */ public function extractRequestParams( $parseLimit = true ) { - // Cache parameters, for performance and to avoid bug 24564. + // Cache parameters, for performance and to avoid T26564. if ( !isset( $this->mParamCache[$parseLimit] ) ) { $params = $this->getFinalParams(); $results = []; @@ -1326,7 +1326,7 @@ abstract class ApiBase extends ContextSource { } if ( !$allowMultiple && count( $valuesList ) != 1 ) { - // Bug 33482 - Allow entries with | in them for non-multiple values + // T35482 - Allow entries with | in them for non-multiple values if ( in_array( $value, $allowedValues, true ) ) { return $value; } @@ -1718,6 +1718,18 @@ abstract class ApiBase extends ContextSource { $this->logFeatureUsage( $feature ); } $this->addWarning( $msg, 'deprecation', $data ); + + // No real need to deduplicate here, ApiErrorFormatter does that for + // us (assuming the hook is deterministic). + $msgs = [ $this->msg( 'api-usage-mailinglist-ref' ) ]; + Hooks::run( 'ApiDeprecationHelp', [ &$msgs ] ); + if ( count( $msgs ) > 1 ) { + $key = '$' . join( ' $', range( 1, count( $msgs ) ) ); + $msg = ( new RawMessage( $key ) )->params( $msgs ); + } else { + $msg = reset( $msgs ); + } + $this->getMain()->addWarning( $msg, 'deprecation-help' ); } /**