Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#8804 closed defect (bug) (duplicate)

Cannot unset string offsets

Reported by: futuramachina's profile futuramachina Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: General Keywords: string offsets
Focuses: Cc:

Description

I've got the error below upon a fresh install of WP 2.7:

Fatal error: Cannot unset string offsets in /home/thekage/public_html/wp-includes/widgets.php on line 621

The blog actually worked before I logged into the admin area, so now neither the blog nor the admin area works.

Change History (10)

#1 @ryan
16 years ago

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

(In [10314]) Default to empty array if sidebars_widgets is not set. Don't unset array_version if not set. fixes #8804 for trunk

#2 @ryan
16 years ago

(In [10315]) Default to empty array if sidebars_widgets is not set. Don't unset array_version if not set. fixes #8804 for 2.7

#3 @futuramachina
16 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I now get this:

Fatal error: Cannot unset string offsets in /home/thekage/public_html/wp-includes/widgets.php on line 622

Also, before the error above, I've also noticed this error appear after I tried reinstalling:

Fatal error: Cannot use string offset as an array in /home/thekage/public_html/wp-includes/capabilities.php on line 116

#4 @futuramachina
16 years ago

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

Turned out to be a problem with server-side Magic Quotes.

#5 @pepijndevos
16 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Did you fix the issue or turn of magic quotes?
The reality is that al lot of cheap hosts have magic quotes turned on, so i think this should be fixed anyway.
http://www.php.net/stripslashes anyone?

I think the problem is installation related, the installer behaved strangely, but finished after making a config file myself.
After installing the above error occurred.
Why i think it is the installer? because it worked for me after I copied the database from a working WP install.

So a possible workaround is to install on a local server and copy the database over to the server.
Windows: http://www.wampserver.com/en/
Mac: http://www.mamp.info/en/index.php
Linux: http://www.apachefriends.org/en/xampp-linux.html

#6 @Denis-de-Bernardy
16 years ago

Please see #6532. In particular:

http://trac.wordpress.org/ticket/6532#comment:11

(in case it might be the issue)

#7 @Denis-de-Bernardy
16 years ago

specifically, is there any odds that your db option contains utf-8 strings or something along those lines that might corrupt it, by having erroneous string lengths all over the place.

D.

#8 @futuramachina
16 years ago

I've used a .htaccess workaround to fix the magic quotes issue.

#10 @Denis-de-Bernardy
16 years ago

  • Resolution set to duplicate
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.