laruence                                 Mon, 08 Aug 2011 06:49:17 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=314467

Log:
Make codes more clearly, and make the static analyzer silent..

Changed paths:
    U   php/php-src/branches/PHP_5_4/ext/standard/info.c
    U   php/php-src/trunk/ext/standard/info.c

Modified: php/php-src/branches/PHP_5_4/ext/standard/info.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/info.c    2011-08-08 06:42:43 UTC 
(rev 314466)
+++ php/php-src/branches/PHP_5_4/ext/standard/info.c    2011-08-08 06:49:17 UTC 
(rev 314467)
@@ -245,22 +245,22 @@
                                }
                        } else {
                                tmp2 = **tmp;
-                               switch (Z_TYPE_PP(tmp)) {
-                                       default:
-                                               tmp = NULL;
-                                               zval_copy_ctor(&tmp2);
-                                               convert_to_string(&tmp2);
-                                       case IS_STRING:
-                                               if 
(!sapi_module.phpinfo_as_text) {
-                                                       if (Z_STRLEN(tmp2) == 
0) {
-                                                               
php_info_print("<i>no value</i>");
-                                                       } else {
-                                                               
php_info_print_html_esc(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
-                                                       }
-                                               } else {
-                                                       
php_info_print(Z_STRVAL(tmp2));
-                                               }
+                               if (Z_TYPE_PP(tmp) != IS_STRING) {
+                                       tmp = NULL;
+                                       zval_copy_ctor(&tmp2);
+                                       convert_to_string(&tmp2);
                                }
+
+                               if (!sapi_module.phpinfo_as_text) {
+                                       if (Z_STRLEN(tmp2) == 0) {
+                                               php_info_print("<i>no 
value</i>");
+                                       } else {
+                                               
php_info_print_html_esc(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
+                                       }
+                               } else {
+                                       php_info_print(Z_STRVAL(tmp2));
+                               }
+
                                if (!tmp) {
                                        zval_dtor(&tmp2);
                                }

Modified: php/php-src/trunk/ext/standard/info.c
===================================================================
--- php/php-src/trunk/ext/standard/info.c       2011-08-08 06:42:43 UTC (rev 
314466)
+++ php/php-src/trunk/ext/standard/info.c       2011-08-08 06:49:17 UTC (rev 
314467)
@@ -245,22 +245,22 @@
                                }
                        } else {
                                tmp2 = **tmp;
-                               switch (Z_TYPE_PP(tmp)) {
-                                       default:
-                                               tmp = NULL;
-                                               zval_copy_ctor(&tmp2);
-                                               convert_to_string(&tmp2);
-                                       case IS_STRING:
-                                               if 
(!sapi_module.phpinfo_as_text) {
-                                                       if (Z_STRLEN(tmp2) == 
0) {
-                                                               
php_info_print("<i>no value</i>");
-                                                       } else {
-                                                               
php_info_print_html_esc(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
-                                                       }
-                                               } else {
-                                                       
php_info_print(Z_STRVAL(tmp2));
-                                               }
+                               if (Z_TYPE_PP(tmp) != IS_STRING) {
+                                       tmp = NULL;
+                                       zval_copy_ctor(&tmp2);
+                                       convert_to_string(&tmp2);
                                }
+
+                               if (!sapi_module.phpinfo_as_text) {
+                                       if (Z_STRLEN(tmp2) == 0) {
+                                               php_info_print("<i>no 
value</i>");
+                                       } else {
+                                               
php_info_print_html_esc(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
+                                       }
+                               } else {
+                                       php_info_print(Z_STRVAL(tmp2));
+                               }
+
                                if (!tmp) {
                                        zval_dtor(&tmp2);
                                }

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

Reply via email to