freetag: Fix php 7 issue by avoiding counting a non-array (#80)

This commit is contained in:
onli 2018-08-14 22:40:07 +02:00
parent a0c3c4bbff
commit 524b26d0d5
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,5 @@
3.70: Fix php 7 compatibility issue by avoiding counting a non-array
3.69: Fix possible SQL injection for tagnames, Thanks to Brian carpenter (geeknik) and Hanno BÃck
3.67: Iconfont a11y fix (yellowled)

View file

@ -72,7 +72,7 @@ class serendipity_event_freetag extends serendipity_event
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('version', '3.69');
$propbag->add('version', '3.70');
$propbag->add('event_hooks', array(
'frontend_fetchentries' => true,
'frontend_fetchentry' => true,
@ -1346,7 +1346,11 @@ addLoadEvent(enableAutocomplete);
$show_related = serendipity_db_bool($this->get_config('show_related', true));
$elements = count($eventData);
if (is_array($eventData)) {
$elements = count($eventData);
} else {
return;
}
// If not using extended-smarty, we want related entries only when
// showing only one entry. It is better to ask Smarty here than doing