• Resolved clmsvie

    (@clmsvie)


    I encounter a problem when uploading twice a photo with the same filename.

    For testing purposes, I made a clean install of the latest WordPress version with only USP installed. The problem still occurred.

    Issue:

    When uploading a file the second time, random letters are added to the filename and the dot before the file extension gets removed.
    Eg:

    1. upload of “tree.jpg” -> tree.jpg – like expected
    2. upload of “tree.jpg” -> tree-qxK1zHJjAiEsjpg
    3. upload of “tree.jpg” -> tree-ESzKVGCJ7P1ijpg

    After testing I included a gallery plugin for you to see the filenames (filename of the thumbnail shows the issue). Please feel free to upload and test yourself – it’s a demo-only website (please scroll down to see the form): https://usptest.uber.space/upload-test/

    Thanks for looking into it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hi @clmsvie, thanks for your detailed report. This is indeed a bug and will be resolved in the next plugin update. If you are comfortable editing a file, here is the patch that will be applied next version:

    Change 985 in the main plugin file user-submitted-posts.php to:

    $file = $dirname .'/'. $filename . $append .'.'. $extension;

    Save changes and done. Either way, the bug will be fixed in the next release.

    Also just FYI, the login form on your page looks all horiz.-spaced out like that because you pasted the login shortcode using the WP RTE/Visual Editor. When you do that, you introduce artifacts like curly/smart quotes, unwanted tags, and so forth. Best advice is to always use the plain-text editor or block when working with any kind of shortcode or code. For example, check your login shortcode using plain-text editor: you will find it is wrapped with code and/or pre tags. Remove those tags from around the shortcode and the form will display nromally.

    • This reply was modified 4 years, 6 months ago by Jeff Starr. Reason: clarity
    Thread Starter clmsvie

    (@clmsvie)

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Bug] Uploading same image twice results in bad filename’ is closed to new replies.