From: Ilia Alshanetsky Date: Fri, 27 Nov 2009 03:13:59 +0000 (+0000) Subject: Revert gmp patches as they require a newer lib X-Git-Tag: php-5.2.12RC2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea3faadf6a7629bf8cbf3e3fde8fb8246afc5cb5;p=php Revert gmp patches as they require a newer lib --- diff --git a/NEWS b/NEWS index 35d1579bb0..5041b0df14 100644 --- a/NEWS +++ b/NEWS @@ -3,8 +3,6 @@ PHP NEWS ?? Nov 2009, PHP 5.2.12RC2 - Updated timezone database to version 2009.19 (2009s). (Derick) -- Changed gmp_strval() to use full range from 2 to 62, and -2 to -36. FR #50283 - (David Soria Parra) - Changed "post_max_size" php.ini directive to allow unlimited post size by setting it to 0. (Rasmus) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index f2eca0a476..406862ebaa 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -753,9 +753,9 @@ ZEND_FUNCTION(gmp_init) } if (argc == 2) { - convert_to_long_ex(base_arg); - base = Z_LVAL_PP(base_arg); - if (base < 2 || base > 62) { + convert_to_long_ex(base_arg); + base = Z_LVAL_PP(base_arg); + if (base < 2 || base > 36) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d (should be between 2 and 36)", base); RETURN_FALSE; } @@ -817,12 +817,12 @@ ZEND_FUNCTION(gmp_strval) break; } - if ((base < 2 && base > -2) || base > 62 || base < -36) { + if (base < 2 || base > 36) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d", base); RETURN_FALSE; } - num_len = mpz_sizeinbase(*gmpnum, abs(base)); + num_len = mpz_sizeinbase(*gmpnum, base); out_string = emalloc(num_len+2); if (mpz_sgn(*gmpnum) < 0) { num_len++;