Make WordPress Core


Ignore:
Timestamp:
05/10/2018 05:58:46 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.
Merges [43220] to the 4.9 branch.
Fixes #43583.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/compat.php

    r43037 r43221  
    513513     */
    514514    function is_countable( $var ) {
    515         return ( is_array( $var ) || $var instanceof Countable );
     515        return ( is_array( $var )
     516            || $var instanceof Countable
     517            || $var instanceof SimpleXMLElement
     518            || $var instanceof ResourceBundle
     519        );
    516520    }
    517521}
Note: See TracChangeset for help on using the changeset viewer.