Make WordPress Core


Ignore:
Timestamp:
05/10/2018 05:57:38 PM (7 years ago)
Author:
SergeyBiryukov
Message:

General: In the is_countable() polyfill, if the provided object implements SimpleXMLElement or ResourceBundle, consider it countable.

Props ayeshrajans, jrf, desrosj.
Fixes #43583.

File:
1 edited

Legend:

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

    r43036 r43220  
    521521     */
    522522    function is_countable( $var ) {
    523         return ( is_array( $var ) || $var instanceof Countable );
     523        return ( is_array( $var )
     524            || $var instanceof Countable
     525            || $var instanceof SimpleXMLElement
     526            || $var instanceof ResourceBundle
     527        );
    524528    }
    525529}
Note: See TracChangeset for help on using the changeset viewer.