mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user