Make WordPress Core


Ignore:
Timestamp:
10/18/2020 05:31:37 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Use instanceof instead of a comparison with get_class().

Includes adjusting external libraries which are no longer maintained externally.

Props jrf.
See #50767.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-pclzip.php

    r47123 r49194  
    11721172
    11731173    // ----- Look if the $p_archive is a PclZip object
    1174     if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip'))
     1174    if (is_object($p_archive) && $p_archive instanceof pclzip)
    11751175    {
    11761176
     
    12361236
    12371237    // ----- Look if the $p_archive_to_add is a PclZip object
    1238     if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip'))
     1238    if (is_object($p_archive_to_add) && $p_archive_to_add instanceof pclzip)
    12391239    {
    12401240
Note: See TracChangeset for help on using the changeset viewer.