Skip to content

Commit

Permalink
Issue [#112] / apply is_countable() from native PHP 7.3+ or from Word…
Browse files Browse the repository at this point in the history
…Press polyfill function to avert PHP warnings.
  • Loading branch information
Rad Geek committed Feb 2, 2020
1 parent ebde8e0 commit 645c184
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions syndicatedpost.class.php
Expand Up @@ -705,7 +705,7 @@ public function author () {
$author = array ();

$aa = $this->entry->get_authors();
if (count($aa) > 0) :
if (is_countable($aa) and count($aa) > 0) :
$a = reset($aa);

$author = array(
Expand Down Expand Up @@ -903,7 +903,7 @@ function inline_tags () {
$content = $this->content();
$pattern = FeedWordPressHTML::tagWithAttributeRegex('a', 'rel', 'tag');
preg_match_all($pattern, $content, $refs, PREG_SET_ORDER);
if (count($refs) > 0) :
if (is_countable($refs) and count($refs) > 0) :
foreach ($refs as $ref) :
$tag = FeedWordPressHTML::tagWithAttributeMatch($ref);
$tags[] = $tag['content'];
Expand Down Expand Up @@ -1301,7 +1301,7 @@ function freshness ($format = 'number') {
// Or the hash...
$hash = $this->update_hash();
$seen = $this->stored_hashes($old_post->ID);
if (count($seen) > 0) :
if (is_countable($seen) and count($seen) > 0) :
$updated = !in_array($hash, $seen); // Not seen yet?
else :
$updated = true; // Can't find syndication meta-data
Expand Down

0 comments on commit 645c184

Please sign in to comment.