[wp-trac] [WordPress Trac] #20985: Mute errors when calling file_exists in search_theme_directories

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 16 00:55:48 UTC 2012


#20985: Mute errors when calling file_exists in search_theme_directories
--------------------------+-----------------------------
 Reporter:  goldenapples  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Just upgraded a production site to 3.4, and I noticed some errors on the
 admin screens related to the rewrites done in r20020.

 The site is maintained by another designer in Dreamweaver, and has the
 usual `_notes/dwsync.xml` files strewn around - including, relevantly in
 the `wp-content/themes/` directory.

 After upgrading, on every page of the admin, I see the following warning:

     Warning: file_exists() [function.file-exists]: open_basedir
 restriction in effect. File(/home/p25lh1ao/public_html/ati/wp-
 content/themes/_notes/dwsync.xml/style.css) is not within the allowed
 path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp) in
 /home/p25lh1ao/public_html/ati/wp-includes/theme.php on line 386

 I don't mind the error - it gives me a reason to wonder why Dreamweaver is
 still being used on a site that I've had under version control for a long
 time. But it seems like there should be some checking going on before
 searching for a `style.css` under every file in a directory. I'm not sure
 which would be faster, to simply mute errors, or check `is_dir()` on each
 of the `$sub_dir`s looped through (which could be either directories, as
 assumed, or any kind of file.

 The attached patch fixed the issue for me.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20985>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list