Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#4306 closed defect (bug) (fixed)

function add_option from Alex Stapleton is buggy on 5.0.4

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


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 (1)

array_unset.diff (888 bytes) - added by ryan 14 years ago.
Make sure notoptions is an array before unsetting

Download all attachments as: .zip

Change History (6)

14 years ago

Make sure notoptions is an array before unsetting

#1 follow-up: @ryan
14 years ago

Try that patch.

#2 in reply to: ↑ 1 @hgurol
14 years ago

Replying to ryan:

Try that patch.

Ryan, that patch works fine for me.

#3 @rob1n
14 years ago

  • Keywords has-patch commit added

#4 @ryan
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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

#5 @ryan
14 years ago

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

Note: See TracTickets for help on using tickets.