diff --git a/includes/relais.inc b/includes/relais.inc
index b6a136d..0f5e03a 100644
--- a/includes/relais.inc
+++ b/includes/relais.inc
@@ -108,8 +108,7 @@ function upei_roblib_ill_authenticate($barcode, $surname) {
if ($result->code == '200') {
if (isset($response_data['Problem']) || strtolower($response_data['LastName']) !== strtolower($surname)) {
$err_message = isset($response_data['Problem']['Message']) ? $response_data['Problem']['Message'] : '';
- $err_message .= t( ' Your Campus ID could be incorrect or your Last Name does not match what is stored in the profile for the user with the specified Campus ID');
- $response_data['Problem']['Message'] = $err_message;
+ $response_data['Problem']['Message'] = upei_roblib_ill_build_err_msg($err_message);
return $response_data;
}
$aid = $response_data['AuthorizationId'];
@@ -117,3 +116,13 @@ function upei_roblib_ill_authenticate($barcode, $surname) {
return isset($aid) ? $aid : $response_data;
}
+function upei_roblib_ill_build_err_msg($msg_from_server) {
+ $campus_id = l(t('Campus ID'), 'http://www.upei.ca/vpaf/campuscard');
+ $ill_email = l(t('ill@upei.ca'), 'mailto:ill@upei.ca');
+ $phone = l(t('902-566-0583'), 'tel:902-566-0353');
+ return t('Oops. Something went wrong.
Check the "Your Last Name" and "Your Campus ID" fields - those two need to match what is on file
+. (Your !campus_id appears as the NUMBER near the middle of your campus card). If you do not have a !campus_id, please contact the Robertson Library Service Desk, or,
+call !phone. Note: if you are a student taking online courses only, please email !ill_email.
Server response: @msg_from_server',
+ array('!campus_id' => $campus_id, '!ill_email' => $ill_email, '!phone' => $phone, '@msg_from_server' => $msg_from_server));
+}
+
diff --git a/includes/utilities.inc b/includes/utilities.inc
index bd0cd8e..4da9984 100644
--- a/includes/utilities.inc
+++ b/includes/utilities.inc
@@ -14,7 +14,7 @@ function upei_roblib_ill_check_arr_item(&$value, $key) {
if(is_array($value)) {
array_walk($value, 'upei_roblib_ill_check_arr_item');
} else {
- $value = check_plain($value);
+ $value = filter_xss($value);
}
}