X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=5343248a9c46d4bc1fc05155a352953d095e1050;hb=f5733ddb5e1e13fb2d7e8563924295f31bacabd9;hp=f9f499a10d547982ba66c9304bcf0ced58cfd80e;hpb=1676448145f28cdf5bf399b13a39d909d7e0bb77;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index f9f499a10d..5343248a9c 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -545,7 +545,7 @@ function wfAppendQuery( $url, $query ) { * @param string $url Either fully-qualified or a local path + query * @param string $defaultProto One of the PROTO_* constants. Determines the * protocol to use if $url or $wgServer is protocol-relative - * @return string Fully-qualified URL, current-path-relative URL or false if + * @return string|false Fully-qualified URL, current-path-relative URL or false if * no valid URL can be constructed */ function wfExpandUrl( $url, $defaultProto = PROTO_CURRENT ) { @@ -1385,12 +1385,16 @@ function wfGetLangObj( $langcode = false ) { * @see Message::__construct */ function wfMessage( $key /*...*/ ) { + $message = new Message( $key ); + + // We call Message::params() to reduce code duplication $params = func_get_args(); array_shift( $params ); - if ( isset( $params[0] ) && is_array( $params[0] ) ) { - $params = $params[0]; + if ( $params ) { + call_user_func_array( [ $message, 'params' ], $params ); } - return new Message( $key, $params ); + + return $message; } /** @@ -1995,10 +1999,6 @@ function wfRestoreWarnings() { MediaWiki\suppressWarnings( true ); } -# Autodetect, convert and provide timestamps of various types - -require_once __DIR__ . '/libs/time/defines.php'; - /** * Get a timestamp string in one of various formats *