From 7abbb42d7ec26ce41b122ebd678cb28c36b1ee46 Mon Sep 17 00:00:00 2001 From: duck_ 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: http://svn.automattic.com/wordpress/trunk@18551 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 4f33db995..15fa1ef44 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] == '\\' ); } /**