Skip to content

Commit

Permalink
Closes #5735, Replace preg_match in Folder::isSlashTerm
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7938 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
phpnut committed Dec 18, 2008
1 parent 3daa7c9 commit 7f30d75
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cake/libs/folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,10 +761,8 @@ function realpath($path) {
* @static
*/
function isSlashTerm($path) {
if (preg_match('/[\/\\\]$/', $path)) {
return true;
}
return false;
$lastChar = $path[strlen($path) - 1];
return $lastChar === '/' || $lastChar === '\\';
}
}
?>

0 comments on commit 7f30d75

Please sign in to comment.