]> granicus.if.org Git - php/commitdiff
Revert gmp patches as they require a newer lib
authorIlia Alshanetsky <iliaa@php.net>
Fri, 27 Nov 2009 03:13:59 +0000 (03:13 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 27 Nov 2009 03:13:59 +0000 (03:13 +0000)
NEWS
ext/gmp/gmp.c

diff --git a/NEWS b/NEWS
index 35d1579bb0b032a488461c732c6a409c06307012..5041b0df14467464c032544c46fa042b7d848787 100644 (file)
--- 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)
 
index f2eca0a476b4bb2752158d157b3b33e90bef1b4c..406862ebaac406cc0e49bd906520252f95c2b928 100644 (file)
@@ -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++;