Opened 4 years ago
Last modified 3 years ago
#36831 new defect (bug)
wp_normalize_path in plugin_dir_path
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | has-patch needs-unit-tests reporter-feedback |
Focuses: | Cc: | ||
PR Number: |
Description
I suggest use wp_normalize_path
in plugin_dir_path
Attachments (1)
Change History (5)
#1
@
4 years ago
- Component changed from General to Plugins
- Keywords has-patch needs-unit-tests added
#2
@
4 years ago
I use Windows and XAMPP. For code
<?php var_dump( plugin_dir_path( __FILE__ ));
I have
string(55) "D:\xampp\htdocs\wordpress\wp-content\plugins\my-plugin/"
but should be
string(55) "D:/xampp/htdocs/wordpress/wp-content/plugins/my-plugin/"
#3
@
4 years ago
What's the expectation for having it using /
?
I actually support adding it, although actually feel the existing result is the intended result, it's what's contained within ABSPATH
and works perfectly fine on a windows system.
We don't really change/add things for the sake of adding it though, having a reason for why you expect it one way or another makes things much more valid.
Note: See
TracTickets for help on using
tickets.
@sebastian.pisula Can you explain why this would be needed?