mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 03:56:07 +00:00
Basedir location fixes for ftp fs from DD32. see #6245
git-svn-id: http://svn.automattic.com/wordpress/trunk@7369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
352c9fca90
commit
a4dc527de4
@ -101,14 +101,12 @@ class WP_Filesystem_FTPext{
|
||||
if( false !== $location ){
|
||||
$newbase = path_join($base, substr($abspath, $location + strlen($base)));
|
||||
|
||||
if($echo) printf( __('Changing to %s') . '<br/>', $newbase );
|
||||
if( false !== $this->chdir($newbase) ){ //chdir sometimes returns null under certain circumstances, even when its changed correctly, FALSE will be returned if it doesnt change correctly.
|
||||
$base = $newbase;
|
||||
if($echo) printf( __('Changing to %s') . '<br/>', $newbase );
|
||||
//Check to see if it exists in that folder.
|
||||
if( $this->exists($base . 'wp-settings.php') ){
|
||||
if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' );
|
||||
$this->wp_base = $base;
|
||||
return $this->wp_base;
|
||||
if( $this->exists($newbase . 'wp-settings.php') ){
|
||||
if($echo) printf( __('Found %s'), $newbase . 'wp-settings.php<br/>' );
|
||||
return $newbase;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -133,6 +131,11 @@ class WP_Filesystem_FTPext{
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
//Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
|
||||
if(isset( $files[ 'wp-settings.php' ]) ){
|
||||
if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' );
|
||||
return $base;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -103,14 +103,12 @@ class WP_Filesystem_ftpsockets{
|
||||
if( false !== $location ){
|
||||
$newbase = path_join($base, substr($abspath, $location + strlen($base)));
|
||||
|
||||
if($echo) printf( __('Changing to %s') . '<br/>', $newbase );
|
||||
if( false !== $this->chdir($newbase) ){ //chdir sometimes returns null under certain circumstances, even when its changed correctly, FALSE will be returned if it doesnt change correctly.
|
||||
$base = $newbase;
|
||||
if($echo) printf( __('Changing to %s') . '<br/>', $newbase );
|
||||
//Check to see if it exists in that folder.
|
||||
if( $this->exists($base . 'wp-settings.php') ){
|
||||
if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' );
|
||||
$this->wp_base = $base;
|
||||
return $this->wp_base;
|
||||
if( $this->exists($newbase . 'wp-settings.php') ){
|
||||
if($echo) printf( __('Found %s'), $newbase . 'wp-settings.php<br/>' );
|
||||
return $newbase;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -135,6 +133,11 @@ class WP_Filesystem_ftpsockets{
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
//Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
|
||||
if(isset( $files[ 'wp-settings.php' ]) ){
|
||||
if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' );
|
||||
return $base;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user