Opened 10 years ago
Closed 5 years ago
#36831 closed defect (bug) (wontfix)
wp_normalize_path in plugin_dir_path
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Plugins | Keywords: | has-patch needs-unit-tests reporter-feedback |
| Focuses: | Cc: |
Description
I suggest use wp_normalize_path in plugin_dir_path
Attachments (1)
Change History (7)
#1
@
10 years ago
- Component changed from General to Plugins
- Keywords has-patch needs-unit-tests added
#2
@
10 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
@
10 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.
#6
@
5 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Hello @sebastianpisula,
Thank you for the patch!
Though it looks odd, Windows recognizes both types of slashes and even mixed combinations of the slashes.
I'm closing this ticket as wontfix. Why?
Slashes has been discussed in multiple tickets. As it works, there hasn't yet been a compelling reason to change it.
As @ jrf comments on Ticket 48099:
This is working perfectly fine. The fact that it looks strange is irrelevant.
Thank you again for the patch!
@sebastian.pisula Can you explain why this would be needed?