From 7f30d757396e33a9581b4a197733a87faa9c2919 Mon Sep 17 00:00:00 2001 From: phpnut Date: Thu, 18 Dec 2008 00:22:57 +0000 Subject: [PATCH] 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 --- cake/libs/folder.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cake/libs/folder.php b/cake/libs/folder.php index ef13fd081..daccaa10f 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -761,10 +761,8 @@ class Folder extends Object { * @static */ function isSlashTerm($path) { - if (preg_match('/[\/\\\]$/', $path)) { - return true; - } - return false; + $lastChar = $path[strlen($path) - 1]; + return $lastChar === '/' || $lastChar === '\\'; } } ?> \ No newline at end of file