mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
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
This commit is contained in:
parent
51d2aef086
commit
7abbb42d7e
@ -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