Make WordPress Core


Ignore:
Timestamp:
08/26/2022 06:57:48 PM (4 years ago)
Author:
antpb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r53944 r53946  
    21022102         * a symbolic link.
    21032103         */
    2104         if ( realpath( $path ) == $path ) {
     2104        if ( realpath( $path ) === $path ) {
    21052105                return true;
    21062106        }
    21072107
    2108         if ( strlen( $path ) == 0 || '.' === $path[0] ) {
     2108        if ( strlen( $path ) === 0 || '.' === $path[0] ) {
    21092109                return false;
    21102110        }
Note: See TracChangeset for help on using the changeset viewer.