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

View File

@@ -52,7 +52,7 @@ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $
if ( !empty($mod_keys) ) {
$words = explode("\n", $mod_keys );
foreach ($words as $word) {
foreach ( (array) $words as $word) {
$word = trim($word);
// Skip empty lines
@@ -1235,7 +1235,7 @@ function pingback($content, $post_ID) {
// http://dummy-weblog.org/post.php
// We don't wanna ping first and second types, even if they have a valid <link/>
foreach ( $post_links_temp[0] as $link_test ) :
foreach ( (array) $post_links_temp[0] as $link_test ) :
if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself
&& !is_local_attachment($link_test) ) : // Also, let's never ping local attachments.
$test = parse_url($link_test);