WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/06/2008 08:31:54 PM (13 years ago)
Author:
markjaquith
Message:

Cast to array when using foreach(). Props santosj (and thanks for your perseverance!). fixes #2784

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/feed.php

    r8246 r8572  
    399399        return;
    400400
    401     foreach (get_post_custom() as $key => $val) {
     401    foreach ( (array) get_post_custom() as $key => $val) {
    402402        if ($key == 'enclosure') {
    403             foreach ((array)$val as $enc) {
     403            foreach ( (array) $val as $enc ) {
    404404                $enclosure = split("\n", $enc);
    405405                echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
     
    431431        return;
    432432
    433     foreach (get_post_custom() as $key => $val) {
     433    foreach ( (array) get_post_custom() as $key => $val ) {
    434434        if ($key == 'enclosure') {
    435             foreach ((array)$val as $enc) {
     435            foreach ( (array) $val as $enc ) {
    436436                $enclosure = split("\n", $enc);
    437437                echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
Note: See TracChangeset for help on using the changeset viewer.