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:
parent
7f88e981ac
commit
2498d24c9b
@ -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] == '\\' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user