From 2498d24c9b3c1374f52d8ea42977a9744b172df1 Mon Sep 17 00:00:00 2001 From: Jon Cave Date: Tue, 16 Aug 2011 00:21:56 +0000 Subject: [PATCH] Replace regex in path_is_absolute() with simpler equality checks. props coffee2code. fixes #17754 git-svn-id: https://develop.svn.wordpress.org/trunk@18551 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 4f33db9957..15fa1ef444 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2125,7 +2125,7 @@ function path_is_absolute( $path ) { return true; // a path starting with / or \ is absolute; anything else is relative - return (bool) preg_match('#^[/\\\\]#', $path); + return ( $path[0] == '/' || $path[0] == '\\' ); } /**