return NULL;
}
// CRM-15901: Turn off PHP errors display for all ajax calls
- if (CRM_Utils_Array::value(1, $args) == 'ajax' || CRM_Utils_Array::value('snippet', $_REQUEST)) {
+ if (CRM_Utils_Array::value(1, $args) == 'ajax' || !empty($_REQUEST['snippet'])) {
ini_set('display_errors', 0);
}
return CRM_Utils_System::redirect();
}
else {
- CRM_Core_Error::fatal('You do not have permission to execute this url');
+ CRM_Core_Error::statusBounce('You do not have permission to execute this url');
}
}
}
stream_wrapper_unregister('phar');
stream_wrapper_register('phar', \TYPO3\PharStreamWrapper\PharStreamWrapper::class);
}
- } else {
+ }
+ else {
// this is not an exception we can handle
throw $e;
}
if (!array_key_exists('page_callback', $item)) {
CRM_Core_Error::debug('Bad item', $item);
- CRM_Core_Error::fatal(ts('Bad menu record in database'));
+ CRM_Core_Error::statusBounce(ts('Bad menu record in database'));
}
// check that we are permissioned to access this page
$object = new $item['page_callback']($title, TRUE, $mode, NULL, $addSequence);
}
else {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Execute supplied menu action');
}
$result = $object->run($newArgs, $pageArgs);
}