X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiBase.php;h=6bfdbacff99229d3e4f21887e37752a1fa9d75fb;hp=62d73f480c0c0210cdf461e98f3b17530fe95ee2;hb=80f787fba3e8dcbf959f37f925a6f6a89979a5c0;hpb=16ef3e79c4c52aa6b74563b7eadcfc9792e7a4c4 diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 62d73f480c..6bfdbacff9 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -897,7 +897,7 @@ abstract class ApiBase extends ContextSource { if ( $badParams ) { $this->dieWithError( - [ 'apierror-mustpostparams', join( ', ', $badParams ), count( $badParams ) ] + [ 'apierror-mustpostparams', implode( ', ', $badParams ), count( $badParams ) ] ); } } @@ -1152,7 +1152,7 @@ abstract class ApiBase extends ContextSource { if ( $multi ) { // This loses the potential $wgContLang->checkTitleEncoding() transformation // done by WebRequest for $_GET. Let's call that a feature. - $value = join( "\x1f", $request->normalizeUnicode( explode( "\x1f", $rawValue ) ) ); + $value = implode( "\x1f", $request->normalizeUnicode( explode( "\x1f", $rawValue ) ) ); } else { $this->dieWithError( 'apierror-badvalue-notmultivalue', 'badvalue_notmultivalue' ); } @@ -1615,6 +1615,10 @@ abstract class ApiBase extends ContextSource { * @return string Validated and normalized parameter */ private function validateUser( $value, $encParamName ) { + if ( ExternalUserNames::isExternal( $value ) && User::newFromName( $value, false ) ) { + return $value; + } + $title = Title::makeTitleSafe( NS_USER, $value ); if ( $title === null || $title->hasFragment() ) { $this->dieWithError( @@ -1829,7 +1833,7 @@ abstract class ApiBase extends ContextSource { $msgs = [ $this->msg( 'api-usage-mailinglist-ref' ) ]; Hooks::run( 'ApiDeprecationHelp', [ &$msgs ] ); if ( count( $msgs ) > 1 ) { - $key = '$' . join( ' $', range( 1, count( $msgs ) ) ); + $key = '$' . implode( ' $', range( 1, count( $msgs ) ) ); $msg = ( new RawMessage( $key ) )->params( $msgs ); } else { $msg = reset( $msgs ); @@ -2461,7 +2465,7 @@ abstract class ApiBase extends ContextSource { realpath( __DIR__ ) ?: __DIR__ => [ 'path' => $IP, 'name' => 'MediaWiki', - 'license-name' => 'GPL-2.0+', + 'license-name' => 'GPL-2.0-or-later', ], realpath( "$IP/extensions" ) ?: "$IP/extensions" => null, realpath( $extDir ) ?: $extDir => null, @@ -2585,16 +2589,6 @@ abstract class ApiBase extends ContextSource { return false; } - /** - * @deprecated since 1.25, always returns empty string - * @param IDatabase|bool $db - * @return string - */ - public function getModuleProfileName( $db = false ) { - wfDeprecated( __METHOD__, '1.25' ); - return ''; - } - /** * @deprecated since 1.25 */ @@ -2641,15 +2635,6 @@ abstract class ApiBase extends ContextSource { wfDeprecated( __METHOD__, '1.25' ); } - /** - * @deprecated since 1.25, always returns 0 - * @return float - */ - public function getProfileDBTime() { - wfDeprecated( __METHOD__, '1.25' ); - return 0; - } - /** * Call wfTransactionalTimeLimit() if this request was POSTed * @since 1.26