diff --git a/calendar/inc/class.calendar_merge.inc.php b/calendar/inc/class.calendar_merge.inc.php index c5f02fd163..a1eb62ff07 100644 --- a/calendar/inc/class.calendar_merge.inc.php +++ b/calendar/inc/class.calendar_merge.inc.php @@ -135,7 +135,12 @@ class calendar_merge extends bo_merge $events = array($id); $this->ids = $events; } - + // as this function allows to pass query- parameters, we need to check the result of the query against export_limit restrictions + if (bo_merge::hasExportLimit($this->export_limit) && !bo_merge::is_export_limit_excepted() && count($events) > (int)$this->export_limit) + { + $err = lang('No rights to export more then %1 entries!',(int)$this->export_limit); + throw new egw_exception_wrong_userinput($err); + } $replacements = array(); $n = 0; foreach($events as $event) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index d0a35a65cf..1ae3059dad 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -601,12 +601,22 @@ abstract class bo_merge if ($contentrepeat) $content = $contentrepeat; //content to repeat if ($lableprint) $content = $Labelrepeat; - // generate replacements - if(!($replacements = $this->get_replacements($id,$content))) + // generate replacements; if exeption is thrown, catch it set error message and return false + try { - $err = lang('Entry not found!'); + if(!($replacements = $this->get_replacements($id,$content))) + { + $err = lang('Entry not found!'); + return false; + } + } + catch (egw_exception_wrong_userinput $e) + { + // if this returns with an exeption, something failed big time + $err = $e->getMessage(); return false; } + // some general replacements: current user, date and time if (strpos($content,'$$user/') !== null && ($user = $GLOBALS['egw']->accounts->id2name($GLOBALS['egw_info']['user']['account_id'],'person_id'))) {