Make WordPress Core


Ignore:
Timestamp:
11/10/2014 02:04:22 AM (9 years ago)
Author:
boonebgorges
Message:

Fix PHP notice in Tests_Feed_RSS2::test_items().

A notice was being thrown when get_the_tags() returned false, and foreach()
was run over that return value.

See [30283].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/feed/rss2.php

    r30283 r30295  
    126126                $cats[] = $term->name;
    127127            }
    128             foreach ( get_the_tags( $post->ID ) as $term ) {
    129                 $cats[] = $term->name;
     128
     129            $tags = get_the_tags( $post->ID );
     130            if ( $tags ) {
     131                foreach ( get_the_tags( $post->ID ) as $term ) {
     132                    $cats[] = $term->name;
     133                }
    130134            }
    131135            $cats = array_filter( $cats );
Note: See TracChangeset for help on using the changeset viewer.