sas             Sun Oct  6 22:37:50 2002 EDT

  Modified files:              
    /php4/ext/session   session.c 
  Log:
  Print out warning only, if a variable was actually migrated
  
  
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.334 php4/ext/session/session.c:1.335
--- php4/ext/session/session.c:1.334    Sun Oct  6 17:47:54 2002
+++ php4/ext/session/session.c  Sun Oct  6 22:37:50 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: session.c,v 1.334 2002/10/06 21:47:54 sebastian Exp $ */
+/* $Id: session.c,v 1.335 2002/10/07 02:37:50 sas Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -611,13 +611,14 @@
        }
 }
 
-static void migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC)
+static int migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC)
 {
        char *str;
        uint str_len;
        ulong num_key;
        int n;
        zval **val = NULL;
+       int ret = 0;
        
        n = zend_hash_get_current_key_ex(ht, &str, &str_len, &num_key, 0, pos);
 
@@ -626,6 +627,7 @@
                        zend_hash_find(&EG(symbol_table), str, str_len, (void **) 
&val);
                        if (val) {
                                ZEND_SET_SYMBOL_WITH_LENGTH(ht, str, str_len, *val, 
(*val)->refcount + 1 , 1);
+                               ret = 1;
                        }
                        break;
                case HASH_KEY_IS_LONG:
@@ -634,6 +636,8 @@
                                        "numeric nature.", num_key);
                        break;
        }
+       
+       return ret;
 }
 
 static void php_session_save_current_state(TSRMLS_D)
@@ -652,9 +656,8 @@
                        while (zend_hash_get_current_data_ex(ht, 
                                                (void **) &val, &pos) != FAILURE) {
                                if (Z_TYPE_PP(val) == IS_NULL) {
-                                       do_warn = 1;
-
-                                       migrate_global(ht, &pos TSRMLS_CC);
+                                       if (migrate_global(ht, &pos TSRMLS_CC))
+                                               do_warn = 1;
                                }
                                zend_hash_move_forward_ex(ht, &pos);
                        }



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

Reply via email to