#29726 closed defect (bug) (duplicate)
Mixed Backward and Forward Slashes
Reported by: | cyberwani | Owned by: | dd32 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.1 |
Component: | General | Keywords: | dev-feedback |
Focuses: | Cc: |
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)
#1
@
10 years ago
- Keywords dev-feedback added
- Owner set to dd32
- Status changed from new to reviewing
Note: See
TracTickets for help on using
tickets.
@dd32: Mind taking a look here?