[freetag] constantly generates PHP warning in the log
Posted: Thu Jul 10, 2014 5:32 am
While troubleshooting for a fatal error caused by SPARTACUS (for some reason, the php file was slightly corrupted), I noticed another string of errors stemming from the freetag plugin in the Apache server log:
This seems to be generated quite often, but not always when a page is loaded.
Looking at the code, it seems to be related to the line that goes like this:
The code may pass array_map() to $showtag, but explode() doesn't seems to like this. I wonder why it's coded this way, and would there be a way to avoid generating the errors in the log?
Code: Select all
PHP Warning: explode() expects parameter 2 to be string, array given in (path)/serendipity_event_freetag.php on line 1037, referer: (site)/plugin/tag/(tag name)/
Looking at the code, it seems to be related to the line that goes like this:
Code: Select all
if (!empty($this->tags['show'])) {
if (is_array($this->tags['show'])) {
$showtag = array_map('serendipity_db_escape_string', $this->tags['show']);
} else {
$showtag = serendipity_db_escape_string($this->tags['show']);
}
} else if (!empty($serendipity['GET']['tag'])) {
$showtag = serendipity_db_escape_string(urldecode($serendipity['GET']['tag']));
}
$arr_showtag = explode(';', $showtag);