Bug: Subfolders with short names might be wrongfully displayed as top folder
-
Subfolders with short names might be wrongfully displayed as top folder.
If the subfolder is a substring of the top folder, the tree structure is wrong.
Example file: https://www.example.com/wp-content/uploads/files/xxx/f/xyz.jpg
The relevant function too check is:
Parameters: uploads_dir: uploads folder_name: f folder_path: https://www.example.com/wp-content/uploads/files/xxx/f private function is_new_top_level_folder($uploads_dir, $folder_name, $folder_path) { $needle = $uploads_dir . '/' . $folder_name; if(strpos($folder_path, $needle)) return true; else return false; }
Suggested quick fix:
private function is_new_top_level_folder($uploads_dir, $folder_name, $folder_path) { $needle = $uploads_dir . '/' . $folder_name; if(strpos($folder_path . '/' , $needle . '/')) // FIX return true; else return false; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Bug: Subfolders with short names might be wrongfully displayed as top folder’ is closed to new replies.