From 1356e3b18d85a95173b392ce97ccd70a4a05f94a Mon Sep 17 00:00:00 2001 From: Anthony Burchell Date: Fri, 26 Aug 2022 18:57:48 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@53946 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 12f813fa9d..f5b58315af 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -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; }