(bug 47023) Add array type check before being used in foreach loop

Change-Id: I28e7f1a52b337ee0a4b012ad31e8054c8f6798ed
This commit is contained in:
bsitu 2013-04-08 16:43:18 -07:00
parent 47d8fefbd2
commit 7ca8d2e4a2

View file

@ -103,6 +103,10 @@ abstract class EchoDiscussionParser {
$output = self::parseNonEditWikitext( $content, new Article( $title ) ); $output = self::parseNonEditWikitext( $content, new Article( $title ) );
$links = $output->getLinks(); $links = $output->getLinks();
if ( !isset( $links[NS_USER] ) || !is_array( $links[NS_USER] ) ) {
return;
}
$mentionedUsers = array(); $mentionedUsers = array();
$count = 0; $count = 0;