Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#25572 closed defect (bug) (fixed)

3.7-beta2-25760 - warning message on update-core.php

Reported by: harmr's profile harmr Owned by: nacin's profile nacin
Milestone: 3.7 Priority: normal
Severity: major Version: 3.7
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

I use 3.7-beta2-25760 and when I go to Dashboard / Updates, I get the following error message below "An updated version of WordPress is available.":

Warning: is_dir(): open_basedir restriction in effect. File(/home/htdocs/.svn) is not within the allowed path(s): (/var/cache/liveconfig/installer/:/tmp/:/home/htdocs/) in /home/htdocs/html/wp-admin/includes/class-wp-upgrader.php on line 1510
Warning: is_dir(): open_basedir restriction in effect. File(/home/.svn) is not within the allowed path(s): (/var/cache/liveconfig/installer/:/tmp/:/home/htdocs/) in /home/htdocs/html/wp-admin/includes/class-wp-upgrader.php on line 1510
Warning: is_dir(): open_basedir restriction in effect. File(/home/htdocs/.git) is not within the allowed path(s): (/var/cache/liveconfig/installer/:/tmp/:/home/htdocs/) in /home/htdocs/html/wp-admin/includes/class-wp-upgrader.php on line 1510
Warning: is_dir(): open_basedir restriction in effect. File(/home/.git) is not within the allowed path(s): (/var/cache/liveconfig/installer/:/tmp/:/home/htdocs/) in /home/htdocs/html/wp-admin/includes/class-wp-upgrader.php on line 1510
Warning: is_dir(): open_basedir restriction in effect. File(/home/htdocs/.hg) is not within the allowed path(s): (/var/cache/liveconfig/installer/:/tmp/:/home/htdocs/) in /home/htdocs/html/wp-admin/includes/class-wp-upgrader.php on line 1510
Warning: is_dir(): open_basedir restriction in effect. File(/home/.hg) is not within the allowed path(s): (/var/cache/liveconfig/installer/:/tmp/:/home/htdocs/) in /home/htdocs/html/wp-admin/includes/class-wp-upgrader.php on line 1510
Warning: is_dir(): open_basedir restriction in effect. File(/home/htdocs/.bzr) is not within the allowed path(s): (/var/cache/liveconfig/installer/:/tmp/:/home/htdocs/) in /home/htdocs/html/wp-admin/includes/class-wp-upgrader.php on line 1510
Warning: is_dir(): open_basedir restriction in effect. File(/home/.bzr) is not within the allowed path(s): (/var/cache/liveconfig/installer/:/tmp/:/home/htdocs/) in /home/htdocs/html/wp-admin/includes/class-wp-upgrader.php on line 1510

The automatic updates works though.

Attachments (4)

25572.diff (1.7 KB) - added by nacin 11 years ago.
25572.2.diff (603 bytes) - added by nacin 11 years ago.
25572.3.diff (807 bytes) - added by nacin 11 years ago.
25572.4.diff (886 bytes) - added by nacin 11 years ago.

Download all attachments as: .zip

Change History (11)

#1 @markoheijnen
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closing this as duplicate of #22704. The issue is already mentioned there.

#2 @SergeyBiryukov
11 years ago

  • Description modified (diff)

#3 @nacin
11 years ago

  • Milestone set to 3.7
  • Resolution duplicate deleted
  • Severity changed from normal to major
  • Status changed from closed to reopened

Reopening this, as #22704 is a behemoth. It's good to have individual bug reports separate from task tickets.

@nacin
11 years ago

@nacin
11 years ago

@nacin
11 years ago

@nacin
11 years ago

#4 @nacin
11 years ago

Four possible patches.

  1. 25572.diff actually tries to catch is_dir() warnings. The ini_set('open_basedir', '/Users/nacin/Sites/develop/build/'); line is debug code. Only tested for open_basedir, not safe_mode.
  1. 25572.2.diff simply @'s is_dir().
  1. 25572.3.diff @'s the main dir we're checking (inside of which we're looking for .svn, etc.) and breaks if we can't access it. A continue isn't needed as the next directory is only going to be further up. Leaning toward this one even though it would be an extra directory call.
  1. But at this point we could switch to scandir(), since we need to check inside each directory for 4 directories anyway. So, that'd be 25572.4.diff. but I don't actually know how performant that'd be, especially if directories above us are large.

#5 @nacin
11 years ago

Going with 2.diff. It's without a doubt the most flexible option. 1.diff handles only one possible issue with is_dir() failing. 3.diff optimizes for bailing early on a possible open_basedir restriction, but at the expense of an extra is_dir() call. In 4.diff, scandir() could return who knows how many files, especially as we venture up

#6 @nacin
11 years ago

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

In 25764:

Silence possible warnings from is_dir(). fixes #25572.

#7 @SergeyBiryukov
11 years ago

  • Version changed from trunk to 3.7
Note: See TracTickets for help on using tickets.