[wp-trac] [WordPress Trac] #18977: Make import.php dynamic

WordPress Trac noreply at wordpress.org
Thu Nov 15 13:46:26 UTC 2012


#18977: Make import.php dynamic
----------------------------+-----------------------
 Reporter:  jane            |       Owner:  nacin
     Type:  task (blessed)  |      Status:  accepted
 Priority:  normal          |   Milestone:  3.5
Component:  Import          |     Version:  3.3
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+-----------------------
Changes (by dllh):

 * keywords:  has-patch commit => has-patch


Comment:

 18977.2.patch can cache bad data if the remote request returns but
 contains bad data. For example, I changed the hostname to
 xapi.wordpress.org and wound up caching an error page in the transient,
 which resulted in an error (couldn't do foreach) on the import page. Since
 the hostname's hard-coded, this particular error's not likely, but say the
 web server returned a 500 and an error document.

 So we need either to check for a 200 response or to check to make sure
 {{{$popular_importers}}} as populated by the request looks valid. I favor
 checking to make sure the response is an array over checking for a 200.
 For example, say somebody hosed up the output from the api so that it
 returned a 200 but not a serialized array. We'd encounter a similar issue
 to what I've tested above.

 The forthcoming patch does an {{{is_array()}}} check and unsets
 {{{$popular_importers}}} if not true so that the fallback return at the
 end of the function is used in this case.

 Removing the commit keyword so that my patch doesn't accidentally get
 committed unreviewed.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18977#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list