Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 4c2b772..cfe9a87 100644 (file)
@@ -38,6 +38,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 if ( !function_exists( 'mb_substr' ) ) {
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_substr
         * @return string
         */
        function mb_substr( $str, $start, $count = 'end' ) {
@@ -46,6 +47,7 @@ if ( !function_exists( 'mb_substr' ) ) {
 
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_substr_split_unicode
         * @return int
         */
        function mb_substr_split_unicode( $str, $splitPos ) {
@@ -56,6 +58,7 @@ if ( !function_exists( 'mb_substr' ) ) {
 if ( !function_exists( 'mb_strlen' ) ) {
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_strlen
         * @return int
         */
        function mb_strlen( $str, $enc = '' ) {
@@ -66,6 +69,7 @@ if ( !function_exists( 'mb_strlen' ) ) {
 if ( !function_exists( 'mb_strpos' ) ) {
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_strpos
         * @return int
         */
        function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
@@ -76,6 +80,7 @@ if ( !function_exists( 'mb_strpos' ) ) {
 if ( !function_exists( 'mb_strrpos' ) ) {
        /**
         * @codeCoverageIgnore
+        * @see Fallback::mb_strrpos
         * @return int
         */
        function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
@@ -88,6 +93,7 @@ if ( !function_exists( 'mb_strrpos' ) ) {
 if ( !function_exists( 'gzdecode' ) ) {
        /**
         * @codeCoverageIgnore
+        * @param string $data
         * @return string
         */
        function gzdecode( $data ) {
@@ -3360,7 +3366,10 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1,
        );
 
        if ( extension_loaded( 'gmp' ) && ( $engine == 'auto' || $engine == 'gmp' ) ) {
-               $result = gmp_strval( gmp_init( $input, $sourceBase ), $destBase );
+               // Removing leading zeros works around broken base detection code in
+               // some PHP versions (see <https://bugs.php.net/bug.php?id=50175> and
+               // <https://bugs.php.net/bug.php?id=55398>).
+               $result = gmp_strval( gmp_init( ltrim( $input, '0' ), $sourceBase ), $destBase );
        } elseif ( extension_loaded( 'bcmath' ) && ( $engine == 'auto' || $engine == 'bcmath' ) ) {
                $decimal = '0';
                foreach ( str_split( strtolower( $input ) ) as $char ) {