}
$callers = debug_backtrace();
+
+ if (count($callers) > 1) {
+ $function = $callers[1]['function'];
+ } else {
+ $function = '';
+ }
+
$logline = sprintf("%s@%s\t[%s]:%s:%s:%s\t%s\n",
DateTimeFormat::utcNow(DateTimeFormat::ATOM),
$process_id,
$LOGGER_LEVELS[$level],
basename($callers[0]['file']),
$callers[0]['line'],
- $callers[1]['function'],
+ $function,
$msg
);
]);
}
- $id = end(explode('/', $the_url));
+ $url_parts = explode('/', $the_url);
+ $id = end($url_parts);
$as .= replace_macros(get_markup_template('video_top.tpl'), [
'$video' => [
'id' => $id,
* @return string
*/
function item_post_type($item) {
- if (intval($item['event-id'])) {
+ if (!empty($item['event-id'])) {
return L10n::t('event');
- } elseif (strlen($item['resource-id'])) {
+ } elseif (!empty($item['resource-id'])) {
return L10n::t('photo');
- } elseif (strlen($item['verb']) && $item['verb'] !== ACTIVITY_POST) {
+ } elseif (!empty($item['verb']) && $item['verb'] !== ACTIVITY_POST) {
return L10n::t('activity');
} elseif ($item['id'] != $item['parent']) {
return L10n::t('comment');