[wp-trac] [WordPress Trac] #57074: Remove extra slashes when concatenating ABSPATH with a path

WordPress Trac noreply at wordpress.org
Fri Nov 11 14:34:01 UTC 2022


#57074: Remove extra slashes when concatenating ABSPATH with a path
------------------------------+-----------------------
 Reporter:  TobiasBg          |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  6.2
Component:  General           |    Version:
 Severity:  normal            |   Keywords:  has-patch
  Focuses:  coding-standards  |
------------------------------+-----------------------
 Follow-up to @emanuelx's findings in #57071:

 `ABSPATH` is defined and documented to end with a forward slash `/`.
 In some Core files, a string that begins with a `/` is appended, leading
 to `//` in the resulting path.
 While this usually doesn't lead to issues, it at least brings confusion.

 Searching for `ABSPATH . '/` and `ABSPATH . "/` revealed 13 files where
 this happens.
 The attached patch removes the extra `/`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57074>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list