WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/07/2011 08:55:25 AM (9 years ago)
Author:
westi
Message:

Ensure that we always coerce the class list passed to get_body_class to an array even when it is empty. Fixes #17717

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r18062 r18176  
    530530    }
    531531
    532     if ( !empty( $class ) ) {
     532    if ( ! empty( $class ) ) {
    533533        if ( !is_array( $class ) )
    534534            $class = preg_split( '#\s+#', $class );
    535535        $classes = array_merge( $classes, $class );
     536    } else {
     537        // Ensure that we always coerce class to being an array.
     538        $class = array();
    536539    }
    537540
Note: See TracChangeset for help on using the changeset viewer.