[wp-trac] Re: [WordPress Trac] #6412: IIS6 PHP5 "Invalid argument
supplied for foreach() ... wp-includes\media.php on line 262"
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 2 13:30:18 GMT 2008
#6412: IIS6 PHP5 "Invalid argument supplied for foreach() ... wp-
includes\media.php on line 262"
----------------------------+-----------------------------------------------
Reporter: dreamcolor | Owner: andy
Type: defect | Status: new
Priority: normal | Milestone: 2.6
Component: Administration | Version: 2.5
Severity: normal | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Comment (by firebird75):
I have the same issue. I have debugged it and I know where it come from.
In the wp_postmeta table in the DB, you have a field called meta_value
which gives the some information about the pictures in the gallery.
It looks like this :
a:5:{s:5:"width";i:158;s:6:"height";i:69;s:14:"hwstring_small";s:23:"height='55'
width='128'";s:4:"file";s:67:"/homepages/13/4375/htdocs/blog/wp-
content/uploads/2008/01/logo.jpg";s:5:"thumb";s:18:"logo.thumbnail.jpg";}
The number after the s: gives the length of the parameter value after the
second :
For unknown reasons, the value isn't correct, it is too high (here 67
while it should be 66). If you perform the change manually into the DB to
set it to the correct value, it works fine, the error goes away. The
problem is that when you have 500 pictures, it could be very long to
perform the change manually for all pictures...
I personnaly started to have problems with pictures in the gallery
following a blog @ change (removed a directory in the URL/path).
I guess the solution would be to fix the value on the fly if it is
discovered that it isn't good by just calculating the lenght of the string
between the " ".
The problem isn't related to IIS6. My WP runs on linux/apache.
--
Ticket URL: <http://trac.wordpress.org/ticket/6412#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list