wfBaseConvert(): Work around PHP Bug #50175
authorKevin Israel <pleasestand@live.com>
Tue, 2 Sep 2014 19:33:43 +0000 (15:33 -0400)
committerKevin Israel <pleasestand@live.com>
Tue, 2 Sep 2014 20:02:27 +0000 (16:02 -0400)
commit5957856c46c3c351b88b6f150ccd39afb5be2c5c
tree55033d46aa74f0d0872fa9cd95a0b9681a6affd3
parentda83f3e91b4eb7de1a8f8101a03538671cc5256b
wfBaseConvert(): Work around PHP Bug #50175

Before php/php-src@834daa455bc9, PHP's gmp_init() function would try
to autodetect hex and binary numbers even when a base was explicitly
specified[1], so the results for some base-36 numbers having leading
zeros could be incorrect. Work around this bug by trimming off any
leading zeros before calling gmp_init().

[1]: https://bugs.php.net/bug.php?id=50175

Bug: 69249
Change-Id: I5f5458c1a1195f55fa12904c103da6ea7558010a
RELEASE-NOTES-1.24
includes/GlobalFunctions.php
tests/phpunit/includes/GlobalFunctions/wfBaseConvertTest.php