This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Plugin incorrectly references uploads directory

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Plugin incorrectly references uploads directory

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17032
    oloftusoloftus
    Participant

    On websites where WordPress is run in it’s own directory and the upload directory is outside of this directory, the call to [code]wd_asp()->upload_path[/code] on line on line 441 of wp-content/plugins/ajax-search-pro/includes/classes/core/class-asp-init.php incorrectly returns the path of the uploads directory as if it still was in the wordpress directory. E.g.

    Directory structure

    • wordpress (contains WordPress installation)
    • uploads (uploads directory)

    The call to [code]wd_asp()->upload_path[/code] returns wordpress/uploads but should return uploads.

    #17037
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    That constant is defined in the ajax-search-pro\includes\classes\core\class-asp-manager.php file within this function:

    As you can see the upload directory is requested through wp_upload_dir() call, which refers _wp_uploads_dir(), and should always return the correct upload directory.

    Is this not the correct way? Please let me know, I am not too familiar with these modifications myself.

    Also, from what I can see in these docs, if the UPLOADS constant is set in the wp-config.php file, the wp_upload_dir() will return that url relative to the ABSPATH constant. You might need to set that constant as well, I am not sure.

    Let me know!

    #17046
    oloftusoloftus
    Participant

    Hi Ernest,

    Thanks for your quick response and for looking into this for me. You’re quite right, the UPLOADS constant ends up being prefixed with ABSPATH- that’s something I hadn’t noticed and unfortunately something I can’t change without modifying the core.

    A workaround I have now found is to set the UPLOADS constant to “../media”. Although this does generate links like e.g. http://domain.com/../media/mypicture.jpg this is not serious in my case.

    You can close this ticket as the issue is now resolved.

    Thanks again,

    Oli

    #17047
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.