mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Closes #5733, Avoid delegation overhead in Folder::correctSlashFor();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7939 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
7f30d75739
commit
d5b86bc4bf
1 changed files with 5 additions and 5 deletions
|
@ -261,10 +261,7 @@ class Folder extends Object {
|
|||
* @static
|
||||
*/
|
||||
function normalizePath($path) {
|
||||
if (Folder::isWindowsPath($path)) {
|
||||
return '\\';
|
||||
}
|
||||
return '/';
|
||||
return Folder::correctSlashFor($path);
|
||||
}
|
||||
/**
|
||||
* Returns a correct set of slashes for given $path. (\\ for Windows paths and / for other paths.)
|
||||
|
@ -275,7 +272,10 @@ class Folder extends Object {
|
|||
* @static
|
||||
*/
|
||||
function correctSlashFor($path) {
|
||||
return Folder::normalizePath($path);
|
||||
if (Folder::isWindowsPath($path)) {
|
||||
return '\\';
|
||||
}
|
||||
return '/';
|
||||
}
|
||||
/**
|
||||
* Returns $path with added terminating slash (corrected for Windows or other OS).
|
||||
|
|
Loading…
Add table
Reference in a new issue