Ticket #4306 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

function add_option from Alex Stapleton is buggy on 5.0.4

Reported by: hgurol Assigned to: anonymous
Priority: normal Milestone: 2.2.1
Component: Administration Version: 2.2
Severity: major Keywords: Cannot unset string offsets has-patch commit
Cc:

Description

Its a very fresh installation of 2.2 with NO plugins and with the default theme, running on w2k3(iis6), mySql 4.1 and php 5.0.4.

While Im surfing on the admin area, posting or deleting pages, browsing the categories I recieve the below error message. Refreshing the page sometimes solve the problem but mostly it doesnt.

"Fatal error: Cannot unset string offsets in D:\...\...\www\wp-includes\functions.php on line 360 "

I open the functions.php file and go to line 360. I point the "function add_option" remarked as "// thx Alex Stapleton, http://alex.vort-x.net/blog/". I change this function with the version from previous version 2.1.3. And the problem is gone.

I dont know what the real problem is but feeling about a php version issue. I can provide more tests, information or screenshots if needed.

Attachments

array_unset.diff (0.9 kB) - added by ryan on 05/21/07 08:32:02.
Make sure notoptions is an array before unsetting

Change History

05/21/07 08:32:02 changed by ryan

  • attachment array_unset.diff added.

Make sure notoptions is an array before unsetting

(follow-up: ↓ 2 ) 05/21/07 08:37:18 changed by ryan

Try that patch.

(in reply to: ↑ 1 ) 05/21/07 09:56:26 changed by hgurol

Replying to ryan:

Try that patch.

Ryan, that patch works fine for me. thx

05/21/07 12:49:57 changed by rob1n

  • keywords changed from Cannot unset string offsets to Cannot unset string offsets has-patch commit.

05/21/07 16:38:53 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [5500]) Check if is_array before unsetting array index. fixes #4306

05/21/07 16:39:09 changed by ryan

(In [5501]) Check if is_array before unsetting array index. fixes #4306 for 2.3