X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=659ac9d26853b85e6cfc1069d1991d2dbc629219;hb=1796d99f7083c9ac7a5a0f18b14d4e3568af37c9;hp=1a3f50ac437bc7e8050c674b01e2139f4c10fa1c;hpb=ec72c55954462dd2e0864a9cb43d402148b0607e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 1a3f50ac43..659ac9d268 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -712,6 +712,8 @@ function wfAssembleUrl( $urlParts ) { * * @todo Need to integrate this into wfExpandUrl (see T34168) * + * @since 1.19 + * * @param string $urlPath URL path, potentially containing dot-segments * @return string URL path with all dot-segments removed */ @@ -1087,7 +1089,8 @@ function wfIsDebugRawPage() { if ( $cache !== null ) { return $cache; } - # Check for raw action using $_GET not $wgRequest, since the latter might not be initialised yet + // Check for raw action using $_GET not $wgRequest, since the latter might not be initialised yet + // phpcs:ignore MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals if ( ( isset( $_GET['action'] ) && $_GET['action'] == 'raw' ) || ( isset( $_SERVER['SCRIPT_NAME'] ) @@ -1511,9 +1514,10 @@ function wfHostname() { * If $wgShowHostnames is true, the script will also set 'wgHostname' to the * hostname of the server handling the request. * + * @param string $nonce Value from OutputPage::getCSPNonce * @return string */ -function wfReportTime() { +function wfReportTime( $nonce = null ) { global $wgShowHostnames; $elapsed = ( microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT'] ); @@ -1523,7 +1527,7 @@ function wfReportTime() { if ( $wgShowHostnames ) { $reportVars['wgHostname'] = wfHostname(); } - return Skin::makeVariablesScript( $reportVars ); + return Skin::makeVariablesScript( $reportVars, $nonce ); } /** @@ -2559,6 +2563,7 @@ function wfDiff( $before, $after, $params = '-u' ) { * @throws MWException */ function wfUsePHP( $req_ver ) { + wfDeprecated( __FUNCTION__, '1.30' ); $php_ver = PHP_VERSION; if ( version_compare( $php_ver, (string)$req_ver, '<' ) ) { @@ -3035,6 +3040,7 @@ function wfWaitForSlaves( * @param int $seconds */ function wfCountDown( $seconds ) { + wfDeprecated( __FUNCTION__, '1.31' ); for ( $i = $seconds; $i >= 0; $i-- ) { if ( $i != $seconds ) { echo str_repeat( "\x08", strlen( $i + 1 ) ); @@ -3223,7 +3229,7 @@ function wfRunHooks( $event, array $args = [], $deprecatedVersion = null ) { * @param string $format The format string (See php's docs) * @param string $data A binary string of binary data * @param int|bool $length The minimum length of $data or false. This is to - * prevent reading beyond the end of $data. false to disable the check. + * prevent reading beyond the end of $data. false to disable the check. * * Also be careful when using this function to read unsigned 32 bit integer * because php might make it negative.