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
This commit is contained in:
Jon Cave 2011-08-16 00:21:56 +00:00
parent 7f88e981ac
commit 2498d24c9b

View File

@ -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] == '\\' );
}
/**