*/
public static function fatal($message = NULL, $code = NULL, $email = NULL) {
$vars = array(
- 'message' => $message,
+ 'message' => htmlspecialchars($message),
'code' => $code,
);
}
$template = CRM_Core_Smarty::singleton();
+
$template->assign($vars);
$config->userSystem->outputError($template->fetch($config->fatalErrorTemplate));
$file_log = self::createDebugLogger($comp);
$file_log->log("$message\n");
- $str = "<p/><code>$message</code>";
+
+ $str = '<p/><code>' . htmlspecialchars($message) . '</code>';
if ($out && CRM_Core_Permission::check('view debug output')) {
echo $str;
}
$params['processor_id'] = $_GET['processor_id'] = $lastParam;
}
else {
- throw new CRM_Core_Exception("Either 'processor_id' (recommended) or 'processor_name' (deprecated) is
- required
- for payment callback");
+ throw new CRM_Core_Exception("Either 'processor_id' (recommended) or 'processor_name' (deprecated) is required for payment callback.");
}
}
if (isset($params['processor_id'])) {
$sql .= " WHERE pp.id = %2";
$args[2] = array($params['processor_id'], 'Integer');
- $notFound = "No active instances of payment processor ID#'{$params['processor_id']}' were found.";
+ $notFound = ts("No active instances of payment processor %1 were found.", array(1 => $params['processor_id']));
}
else {
// This is called when processor_name is passed - passing processor_id instead is recommended.
'Integer',
);
$args[2] = array($params['processor_name'], 'String');
- $notFound = "No active instances of the '{$params['processor_name']}' payment processor were found.";
+ $notFound = ts("No active instances of payment processor '%1' were found.", array(1 => $params['processor_name']));
}
$dao = CRM_Core_DAO::executeQuery($sql, $args);
}
if (!$extension_instance_found) {
- CRM_Core_Error::fatal(
- "No extension instances of the '{$params['processor_name']}' payment processor were found.<br />" .
- "$method method is unsupported in legacy payment processors."
- );
+ $message = "No extension instances of the '%1' payment processor were found.<br />" .
+ "%2 method is unsupported in legacy payment processors.";
+ CRM_Core_Error::fatal(ts($message, array(1 => $params['processor_name'], 2 => $method)));
}
}