- Timestamp:
- 08/15/2013 05:59:36 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-base.php
r23349 r25024 193 193 $folder = untrailingslashit($folder); 194 194 195 if ( $this->verbose ) 196 printf( "\n" . __('Looking for %1$s in %2$s') . "<br/>\n", $folder, $base ); 197 195 198 $folder_parts = explode('/', $folder); 196 $last_index = array_pop( array_keys( $folder_parts ) ); 199 $folder_part_keys = array_keys( $folder_parts ); 200 $last_index = array_pop( $folder_part_keys ); 197 201 $last_path = $folder_parts[ $last_index ]; 198 202 … … 211 215 $newdir = trailingslashit(path_join($base, $key)); 212 216 if ( $this->verbose ) 213 printf( __('Changing to %s') . '<br/>', $newdir );217 printf( "\n" . __('Changing to %s') . "<br/>\n", $newdir ); 214 218 // only search for the remaining path tokens in the directory, not the full path again 215 219 $newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) ); … … 222 226 if (isset( $files[ $last_path ] ) ) { 223 227 if ( $this->verbose ) 224 printf( __('Found %s') . '<br/>', $base . $last_path );228 printf( "\n" . __('Found %s') . "<br/>\n", $base . $last_path ); 225 229 return trailingslashit($base . $last_path); 226 230 } 227 if ( $loop ) 228 return false; //Prevent this function from looping again. 229 //As an extra last resort, Change back to / if the folder wasn't found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups. 230 return $this->search_for_folder($folder, '/', true); 231 232 // Prevent this function from looping again. 233 // No need to proceed if we've just searched in / 234 if ( $loop || '/' == $base ) 235 return false; 236 237 // As an extra last resort, Change back to / if the folder wasn't found. 238 // This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... 239 return $this->search_for_folder( $folder, '/', true ); 231 240 232 241 }
Note: See TracChangeset
for help on using the changeset viewer.