• Resolved francticpedantic

    (@francticpedantic)


    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)
  • Plugin Author AlanP57

    (@alanp57)

    Thank you. I will look into this and get back to you.

    Plugin Author AlanP57

    (@alanp57)

    Your suggested fix seems to be OK. I’ll be testing it and it will likely be included in the next release.

    Thread Starter francticpedantic

    (@francticpedantic)

    Thank you very much!

    Plugin Author maxfoundry

    (@maxfoundry)

    ping us at support [at] maxfoundry [dot] com, please.

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.