Coding Standards: Use strict comparisons in path_is_absolute().
This patch adjusts conditions to use strict comparisons when comparing `realpath()` in `path_is_absolute()`. Props jrf. See #36308. Built from https://develop.svn.wordpress.org/trunk@53946 git-svn-id: http://core.svn.wordpress.org/trunk@53505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -2101,11 +2101,11 @@ function path_is_absolute( $path ) {
|
||||
* This is definitive if true but fails if $path does not exist or contains
|
||||
* a symbolic link.
|
||||
*/
|
||||
if ( realpath( $path ) == $path ) {
|
||||
if ( realpath( $path ) === $path ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( strlen( $path ) == 0 || '.' === $path[0] ) {
|
||||
if ( strlen( $path ) === 0 || '.' === $path[0] ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user