#29726 closed defect (bug) (duplicate)
Mixed Backward and Forward Slashes
| Reported by: | cyberwani | Owned by: | dd32 |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 4.1 |
| Severity: | normal | Keywords: | dev-feedback |
| Cc: | Focuses: |
Description
Some functions used to get the directory path giving result with mixed backward and forward slashes in Windows. List given here below:
get_template_directory(): D:\wamp\www\wp4/wp-content/themes/potenzabase
get_stylesheet_directory(): D:\wamp\www\wp4/wp-content/themes/potenzabase
get_theme_root(): D:\wamp\www\wp4/wp-content/themes
plugin_dir_path(): D:\wamp\www\wp4\wp-content\themes\potenzabase\includes\cpt/
wp_upload_dir(): Array ( [path] => D:\wamp\www\wp4/wp-content/uploads/2014/09 [url] => http://192.168.22.201/wp4/wp-content/uploads/2014/09 [subdir] => /2014/09 [basedir] => D:\wamp\www\wp4/wp-content/uploads [baseurl] => http://192.168.22.201/wp4/wp-content/uploads [error] => )
This function can fix the slashes.
function fixslash($path){ $sep = DIRECTORY_SEPARATOR; if( $ds == '/' ){ $fix_sep = '\\'; }elseif( $ds == '\\' ){ $fix_sep = '/'; } $path = str_replace($fix_sep,$sep,$path); return $path; }
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
@dd32: Mind taking a look here?