mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user