iliaa           Mon Dec 13 19:38:35 2004 EDT

  Modified files:              (Branch: PHP_5_0)
    /php-src    NEWS 
    /php-src/ext/standard       math.c 
  Log:
  MFH: Fixed bug #28228 (NULL decimal separator is not being handled correctly).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.154&r2=1.1760.2.155&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.154 php-src/NEWS:1.1760.2.155
--- php-src/NEWS:1.1760.2.154   Fri Dec 10 18:06:04 2004
+++ php-src/NEWS        Mon Dec 13 19:38:34 2004
@@ -86,6 +86,8 @@
 - Fixed bug #28598 (Lost support for MS Symbol fonts). (Pierre)
 - Fixed bug #28220 (mb_strwidth() returns wrong width values for some hangul
   characters). (Moriyoshi)
+- Fixed bug #28228 (NULL decimal separator is not being handled correctly).
+  (Ilia)
 - Fixed bug #28209 (strtotime("now")). (Derick)
 - Fixed bug #27798 (private / protected variables not exposed by 
   get_object_vars() inside class). (Marcus)
http://cvs.php.net/diff.php/php-src/ext/standard/math.c?r1=1.115.2.1&r2=1.115.2.2&ty=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.115.2.1 
php-src/ext/standard/math.c:1.115.2.2
--- php-src/ext/standard/math.c:1.115.2.1       Sun Aug  8 17:25:55 2004
+++ php-src/ext/standard/math.c Mon Dec 13 19:38:35 2004
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: math.c,v 1.115.2.1 2004/08/08 21:25:55 iliaa Exp $ */
+/* $Id: math.c,v 1.115.2.2 2004/12/14 00:38:35 iliaa Exp $ */
 
 #include "php.h"
 #include "php_math.h"
@@ -1136,17 +1136,22 @@
                }
                convert_to_double_ex(num);
                convert_to_long_ex(dec);
-               convert_to_string_ex(d_p);
-               convert_to_string_ex(t_s);
-               if (Z_STRLEN_PP(d_p)==1) {
-                       dec_point=Z_STRVAL_PP(d_p)[0];
-               } else if (Z_STRLEN_PP(d_p)==0) {
-                       dec_point=0;
+
+               if (Z_TYPE_PP(d_p) != IS_NULL) { 
+                       convert_to_string_ex(d_p);
+                       if (Z_STRLEN_PP(d_p)==1) {
+                               dec_point=Z_STRVAL_PP(d_p)[0];
+                       } else if (Z_STRLEN_PP(d_p)==0) {
+                               dec_point=0;
+                       }
                }
-               if (Z_STRLEN_PP(t_s)==1) {
-                       thousand_sep=Z_STRVAL_PP(t_s)[0];
-               } else if(Z_STRLEN_PP(t_s)==0) {
-                       thousand_sep=0; 
+               if (Z_TYPE_PP(t_s) != IS_NULL) {
+                       convert_to_string_ex(t_s);
+                       if (Z_STRLEN_PP(t_s)==1) {
+                               thousand_sep=Z_STRVAL_PP(t_s)[0];
+                       } else if(Z_STRLEN_PP(t_s)==0) {
+                               thousand_sep=0; 
+                       }
                }
                RETURN_STRING(_php_math_number_format(Z_DVAL_PP(num), 
Z_LVAL_PP(dec), dec_point, thousand_sep), 0);
                break;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to