WordPress.org

Make WordPress Core

Changes between Initial Version and Version 3 of Ticket #49658


Ignore:
Timestamp:
03/17/2020 08:15:48 PM (17 months ago)
Author:
SergeyBiryukov
Comment:

Hi there, welcome back to WordPress Trac! Thanks for the ticket.

Using DIRECTORY_SEPARATOR in core has been discussed several times before, most recently in #28811, #29726, and #44654. Since Windows recognizes both types of slashes, there is no strong reason for changing this if everything works as expected.

Anywhere in core or plugins where paths need to be compared, wp_normalize_path() should be used.

Some more previous discussions: #15598, #16457, #17494, #20849.

I still get a 500 Internal Server error when using the PATH retrieved by wp_upload_dir() function.

Could you provide the steps to reproduce the issue on a clean install? How are you using the path?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #49658

    • Property Keywords reporter-feedback added; needs-patch removed
    • Property Component changed from General to Upload
  • Ticket #49658 – Description

    initial v3  
    22I was creating a file in the uploads directory and decided to use wp_upload_dir() to get the upload directory path. When I printed the result, I noticed that the path returned was incorrect.
    33Below is the print_r result of the wp_upload_dir() function:
     4{{{
    45Array
    56(
     
    1112    [error] =>
    1213)
    13 
     14}}}
    1415As soon as the path enters in the WordPress directory, backslashes are converted to front slashes.