Browse Source

added regex for issn also some code cleanup

9.x-1.0
Paul Pound 8 years ago
parent
commit
bc89b5adc8
  1. 2
      includes/form.inc
  2. 4
      includes/utilities.inc

2
includes/form.inc

@ -344,7 +344,7 @@ function upei_roblib_ill_request_form($form, &$form_state) {
'#rows' => 2,
'#title' => t('Source Title'),
'#default_value' => upei_roblib_ill_get_request_variable('title'),
'#description' => 'Journal or Book Title',
'#description' => 'Journal or Book Title (Required)',
'#size' => 50,
'#required' => FALSE,
);

4
includes/utilities.inc

@ -55,6 +55,10 @@ function upei_roblib_ill_get_request_variable($variable) {
$last_name = isset($_REQUEST['aulast']) ? $_REQUEST['aulast'] : NULL;
return !empty($last_name) ? $last_name . ',' . $initial : '';
}
if ($variable == 'issn' && !empty($_REQUEST[$variable])) {
// ebsco sometimes sends garbage as issns verify this is a valid issn before displaying the value in the form.
return preg_match('/^\d{4}-?\d{3}[\dxX]$/', $_REQUEST[$variable]) ? $_REQUEST[$variable] : '';
}
return isset($_REQUEST[$variable]) ? $_REQUEST[$variable] : '';
}

Loading…
Cancel
Save