php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1162 serialize misbehaving due to changes in unset
Submitted: 1999-02-19 09:56 UTC Modified: 1999-03-02 06:41 UTC
From: mark dot edwards at wcom dot co dot uk Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.6 OS: Linux RH5.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mark dot edwards at wcom dot co dot uk
New email:
PHP Version: OS:

 

 [1999-02-19 09:56 UTC] mark dot edwards at wcom dot co dot uk
serialize broken with arrays. Here's a fix. Check 'array_each' and 'unset' for reasons...


--- /tmp/var.c  Fri Feb 19 15:32:47 1999
+++ /usr/local/src/php-3.0.6/functions/var.c    Fri Feb 19 15:47:06 1999
@@ -212,6 +212,10 @@
                                        if (_php3_hash_get_current_data(struc->value.ht, (void **) (&data)) != SUCCESS || !data || (data == struc)) {
                                                continue;
                                        }
+                                       /* ref: basic_functions.c/array_each() - needed because of 'variables.c/unset()'.*/
+                                       if (data->type == IS_STRING && data->value.str.val==undefined_variable_string) {
+                                               continue;
+                                       }
                                        switch (i) {
                                                case HASH_KEY_IS_LONG:
                                                        d.type = IS_LONG;


Mark Edwards

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-02 06:41 UTC] sas
fixed in 3.0.7. thanks for the patch
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Sep 19 00:00:01 2025 UTC