From ac8362e34a89b0e513e1304cf0f111c52d27f9e5 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Fri, 23 Mar 2012 17:09:51 +0100 Subject: check if the title of an event is null - bugfix for oc-139 --- apps/calendar/ajax/events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/calendar/ajax') diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index 922df90b76b..cf768f51c6f 100755 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -12,7 +12,7 @@ require_once('when/When.php'); function create_return_event($event, $vevent){ $return_event = array(); $return_event['id'] = (int)$event['id']; - $return_event['title'] = htmlspecialchars($event['summary']); + $return_event['title'] = htmlspecialchars(($event['summary']!=NULL)?$event['summary']:$l->t('unnamed')); $return_event['description'] = isset($vevent->DESCRIPTION)?htmlspecialchars($vevent->DESCRIPTION->value):''; $last_modified = $vevent->__get('LAST-MODIFIED'); if ($last_modified){ -- cgit v1.2.3 From 0e11cc9f6ff6176ae723acd8facef9237252be5f Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Fri, 23 Mar 2012 17:27:52 +0100 Subject: fix previous made bug and fix oc bug - oc-139 --- apps/calendar/ajax/events.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/calendar/ajax') diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index cf768f51c6f..c62f93c540e 100755 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -8,11 +8,13 @@ require_once ('../../../lib/base.php'); require_once('when/When.php'); - +$l = new OC_L10N('calendar'); +$unnamed = $l->t('unnamed'); function create_return_event($event, $vevent){ $return_event = array(); + global $unnamed; $return_event['id'] = (int)$event['id']; - $return_event['title'] = htmlspecialchars(($event['summary']!=NULL)?$event['summary']:$l->t('unnamed')); + $return_event['title'] = htmlspecialchars(($event['summary']!=NULL || $event['summary'] != '')?$event['summary']: $unnamed); $return_event['description'] = isset($vevent->DESCRIPTION)?htmlspecialchars($vevent->DESCRIPTION->value):''; $last_modified = $vevent->__get('LAST-MODIFIED'); if ($last_modified){ -- cgit v1.2.3