Permalink
Browse files

Closes #5735, Replace preg_match in Folder::isSlashTerm

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7938 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
1 parent 3daa7c9 commit 7f30d757396e33a9581b4a197733a87faa9c2919 @phpnut phpnut committed Dec 18, 2008
Showing with 2 additions and 4 deletions.
  1. +2 −4 cake/libs/folder.php
View
6 cake/libs/folder.php
@@ -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.