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

git-svn-id: https://develop.svn.wordpress.org/trunk@8572 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2008-08-06 20:31:54 +00:00
parent 3937bd9530
commit 3cab99fbd2
22 changed files with 125 additions and 124 deletions
+5 -5
View File
@@ -398,9 +398,9 @@ function rss_enclosure() {
if ( !empty($post->post_password) && (!isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || $_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) )
return;
foreach (get_post_custom() as $key => $val) {
foreach ( (array) get_post_custom() as $key => $val) {
if ($key == 'enclosure') {
foreach ((array)$val as $enc) {
foreach ( (array) $val as $enc ) {
$enclosure = split("\n", $enc);
echo apply_filters('rss_enclosure', '<enclosure url="' . trim(htmlspecialchars($enclosure[0])) . '" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
}
@@ -430,9 +430,9 @@ function atom_enclosure() {
if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) )
return;
foreach (get_post_custom() as $key => $val) {
foreach ( (array) get_post_custom() as $key => $val ) {
if ($key == 'enclosure') {
foreach ((array)$val as $enc) {
foreach ( (array) $val as $enc ) {
$enclosure = split("\n", $enc);
echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
}
@@ -501,4 +501,4 @@ function self_link() {
. wp_specialchars(stripslashes($_SERVER['REQUEST_URI']), 1);
}
?>
?>