Skip to content

Commit

Permalink
Fixing another each() use.
Browse files Browse the repository at this point in the history
  • Loading branch information
oppiansteve committed Dec 30, 2019
1 parent 8bb6a17 commit e3a7081
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions syndicatedpost.class.php
Expand Up @@ -2199,13 +2199,14 @@ function author_id ($unfamiliar_author = 'create') {
// or forbidden names.

$author = NULL;
while (is_null($author) and ($candidate = each($candidates))) :
if (!is_null($candidate['value'])
and (strlen(trim($candidate['value'])) > 0)
and !in_array(strtolower(trim($candidate['value'])), $forbidden)) :
$author = $candidate['value'];
foreach ($candidates as $candidate) {
if (!is_null($candidate)
and (strlen(trim($candidate)) > 0)
and !in_array(strtolower(trim($candidate)), $forbidden)) :
$author = $candidate;
break;
endif;
endwhile;
}

$email = (isset($a['email']) ? $a['email'] : NULL);
$authorUrl = (isset($a['uri']) ? $a['uri'] : NULL);
Expand Down

0 comments on commit e3a7081

Please sign in to comment.