freetag: Fix typo, cond instead of ccond, avoids undefined var error (#142)

* Fix typo, cond instead of ccond, avoids undefined var error

* Avoid missing array indexes, array_map will remove indexes and this causes undefined index warnings, array_values fixes this

* raise version for freetag plugin
This commit is contained in:
Hanno Böck 2022-08-21 17:36:30 +02:00 committed by GitHub
parent 9eb6dd26a6
commit 4e51353f17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,7 +66,7 @@ class serendipity_event_freetag extends serendipity_event
'smarty' => '2.6.7',
'php' => '7.0'
));
$propbag->add('version', '3.70.4');
$propbag->add('version', '3.70.5');
$propbag->add('event_hooks', array(
'frontend_fetchentries' => true,
'frontend_fetchentry' => true,
@ -770,7 +770,7 @@ class serendipity_event_freetag extends serendipity_event
$param = array_map('urldecode', $param); // for doubled encoded tag umlauts via searchengines backlinks in sprintf
}
$param = array_map('strip_tags', $param);
$param = array_filter($param); // empty removed XSS by strip_tags
$param = array_values(array_filter($param)); // empty removed XSS by strip_tags
if (function_exists('serendipity_specialchars')) {
$serendipity['head_subtitle'] = sprintf(PLUGIN_EVENT_FREETAG_USING, implode(' + ', array_map('serendipity_specialchars', $param)));
} else {
@ -1572,7 +1572,7 @@ addLoadEvent(enableAutocomplete);
} else if (is_array($tag)) {
$join = "LEFT JOIN {$serendipity['dbPrefix']}entrytags AS neg ".
"ON main.entryid = neg.entryid ";
$ccond = '';
$cond = '';
$ncond = '';
$first = true;