[wp-trac] [WordPress Trac] #13772: _unzip_file_ziparchive fails with open_basedir in effect
WordPress Trac
wp-trac at lists.automattic.com
Mon Jun 7 19:11:39 UTC 2010
#13772: _unzip_file_ziparchive fails with open_basedir in effect
-----------------------------+----------------------------------------------
Reporter: tinuzz | Owner: dd32
Type: defect (bug) | Status: new
Priority: normal | Milestone:
Component: Upgrade/Install | Version: 3.0
Severity: normal | Keywords: open_ basedir mkdir
-----------------------------+----------------------------------------------
Comment(by tinuzz):
A patch, that made it work for me:
--- file.php.orig 2010-06-07 19:03:55.000000000 +0000
+++ file.php 2010-06-07 19:08:24.000000000 +0000
@@ -601,7 +601,6 @@
$needed_dirs[] = $to .
untrailingslashit(dirname($info['name']));
}
- $needed_dirs = array_unique($needed_dirs);
foreach ( $needed_dirs as $dir ) {
// Check the parent folders of the folders all exist
within the creation array.
if ( untrailingslashit($to) == $dir ) // Skip over the
working directory, We know this exists (or will exist)
@@ -609,10 +608,16 @@
$parent_folder = dirname($dir);
while ( !empty($parent_folder) && untrailingslashit($to)
!= $parent_folder && !in_array($parent_folder, $needed_dirs) ) {
- $needed_dirs[] = $parent_folder;
- $parent_folder = dirname($parent_folder);
+ if (substr(WP_CONTENT_DIR, 0,
strlen($parent_folder)) != $parent_folder) {
+ $needed_dirs[] = $parent_folder;
+ $parent_folder = dirname($parent_folder);
+ }
+ else {
+ break;
+ }
}
}
+ $needed_dirs = array_unique($needed_dirs);
asort($needed_dirs);
// Create those directories if need be:
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13772#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list