Ticket #6245: 6245.3.diff
| File 6245.3.diff, 3.6 kB (added by DD32, 6 months ago) |
|---|
-
wp-admin/includes/class-wp-filesystem-ftpext.php
old new 95 95 //Set up the base directory (Which unless specified, is the current one) 96 96 if( empty( $base ) || '.' == $base ) $base = $this->cwd(); 97 97 $base = trailingslashit($base); 98 98 99 99 //Can we see the Current directory as part of the ABSPATH? 100 100 $location = strpos($abspath, $base); 101 101 if( false !== $location ){ 102 102 $newbase = path_join($base, substr($abspath, $location + strlen($base))); 103 104 if($echo) printf( __('Changing to %s') . '<br/>', $newbase ); 103 105 104 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. 106 $base = $newbase;105 if($echo) printf( __('Changing to %s') . '<br/>', $newbase ); 107 106 //Check to see if it exists in that folder. 108 if( $this->exists($base . 'wp-settings.php') ){ 109 if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' ); 110 $this->wp_base = $base; 111 return $this->wp_base; 107 if( $this->exists($newbase . 'wp-settings.php') ){ 108 if($echo) printf( __('Found %s'), $newbase . 'wp-settings.php<br/>' ); 109 return $newbase; 112 110 } 113 111 } 114 112 } … … 133 131 return $ret; 134 132 } 135 133 } 134 //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. 135 if(isset( $files[ 'wp-settings.php' ]) ){ 136 if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' ); 137 return $base; 138 } 136 139 return false; 137 140 } 138 141 -
wp-admin/includes/class-wp-filesystem-ftpsockets.php
old new 97 97 //Set up the base directory (Which unless specified, is the current one) 98 98 if( empty( $base ) || '.' == $base ) $base = $this->cwd(); 99 99 $base = trailingslashit($base); 100 100 101 101 //Can we see the Current directory as part of the ABSPATH? 102 102 $location = strpos($abspath, $base); 103 103 if( false !== $location ){ 104 104 $newbase = path_join($base, substr($abspath, $location + strlen($base))); 105 106 if($echo) printf( __('Changing to %s') . '<br/>', $newbase ); 105 107 106 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. 108 $base = $newbase;107 if($echo) printf( __('Changing to %s') . '<br/>', $newbase ); 109 108 //Check to see if it exists in that folder. 110 if( $this->exists($base . 'wp-settings.php') ){ 111 if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' ); 112 $this->wp_base = $base; 113 return $this->wp_base; 109 if( $this->exists($newbase . 'wp-settings.php') ){ 110 if($echo) printf( __('Found %s'), $newbase . 'wp-settings.php<br/>' ); 111 return $newbase; 114 112 } 115 113 } 116 114 } … … 135 133 return $ret; 136 134 } 137 135 } 136 //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. 137 if(isset( $files[ 'wp-settings.php' ]) ){ 138 if($echo) printf( __('Found %s'), $base . 'wp-settings.php<br/>' ); 139 return $base; 140 } 138 141 return false; 139 142 } 140 143
