diff --git a/booking.balance.inc b/booking.balance.inc index d96272d..86fc820 100644 --- a/booking.balance.inc +++ b/booking.balance.inc @@ -12,7 +12,7 @@ function booking_balance_page() { $paypal_form = ""; //verify that arg(1) is a uuid - if (! ('/^[0-9A-Fa-f\-]+$/', arg(1))) { + if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { //parameter from url is not what we were expecting drupal_set_message("Error: Invalid session ID supplied to the balance payment page. Please use the contact us form to let us know.", 'error', FALSE); drupal_goto(''); diff --git a/booking.confirm.inc b/booking.confirm.inc index 4069cd2..5b3cb3a 100644 --- a/booking.confirm.inc +++ b/booking.confirm.inc @@ -12,7 +12,7 @@ function booking_confirm_page() { $paypal_form = ""; //verify that arg(1) is a uuid - if (! ('/^[0-9A-Fa-f\-]+$/', arg(1))) { + if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { //parameter from url is not what we were expecting drupal_set_message("Error: Invalid session ID supplied to the registration confirmation page. Please use the contact us form to let us know.", 'error', FALSE); drupal_goto(''); @@ -106,7 +106,7 @@ function booking_confirm_page() { $form_action = variable_get('booking_paypal_sandbox', 0) ? BOOKING_PAYPAL_SUBMIT_URL_SANDBOX : BOOKING_PAYPAL_SUBMIT_URL; //verify that arg(1) is a uuid - if (! ('/^[0-9A-Fa-f\-]+$/', arg(1))) { + if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { //parameter from url is not what we were expecting drupal_set_message("Error: Invalid session ID supplied. Please use the contact us form to let us know.", 'error', FALSE); return ""; diff --git a/booking.events.inc b/booking.events.inc index b695215..d067322 100644 --- a/booking.events.inc +++ b/booking.events.inc @@ -115,7 +115,7 @@ function booking_event_form($node, &$form_state, $create, $editid = 0) else { //verify that $editid is a number - if (! ('/^[0-9]+$/', $editid)) { + if (! preg_match('/^[0-9]+$/', $editid)) { drupal_set_message("Error: Invalid event ID supplied. Unable to update event information.", 'error', FALSE); drupal_goto('admin/config/booking/events'); return ""; @@ -222,8 +222,8 @@ function booking_event_form_submit($form, &$form_state) { global $event; $values = $form_state['input']; - date_default_timezone_set('Australia/Sydney'); - $tz = new DateTimeZone('Australia/Sydney'); + date_default_timezone_set(TIMEZONE); + $tz = new DateTimeZone(TIMEZONE); //watchdog('booking', 'Checkboxes when setting buttons: @info', array ('@info' => var_export($checkboxes, TRUE))); @@ -255,7 +255,7 @@ function booking_event_form_submit($form, &$form_state) { elseif ($form_state['values']['op'] == 'Delete') { //verify that booking_eid is a number - if (! ('/^[0-9]+$/', $values['booking_eid'])) { + if (! preg_match('/^[0-9]+$/', $values['booking_eid'])) { drupal_set_message("Error: Invalid event ID supplied. Unable to delete event entry.", 'error', FALSE); return ""; } @@ -271,7 +271,7 @@ function booking_event_form_submit($form, &$form_state) { else { //verify that booking_eid is a number - if (! ('/^[0-9]+$/', $values['booking_eid'])) { + if (! preg_match('/^[0-9]+$/', $values['booking_eid'])) { drupal_set_message("Error: Invalid event ID supplied. Unable to update event entry.", 'error', FALSE); return ""; } diff --git a/booking.partialbalance.inc b/booking.partialbalance.inc index 18e94c5..6886d43 100644 --- a/booking.partialbalance.inc +++ b/booking.partialbalance.inc @@ -14,7 +14,7 @@ function booking_partial_balance_page() { $partial_amount = arg(2); //verify that arg(1) is a uuid - if (! ('/^[0-9A-Fa-f\-]+$/', $temp_id)) { + if (! preg_match('/^[0-9A-Fa-f\-]+$/', $temp_id)) { //parameter from url is not what we were expecting drupal_set_message("Error: Invalid session ID supplied to the partial payment page. Please use the contact us form to let us know.", 'error', FALSE); drupal_goto(''); @@ -22,7 +22,7 @@ function booking_partial_balance_page() { } //verify that arg(2) is a number - if (! ('/^[0-9]+$/', $partial_amount)) { + if (! preg_match('/^[0-9]+$/', $partial_amount)) { drupal_set_message("Error: Invalid payment amount supplied to the partial payment page. Please use the contact us form to let us know.", 'error', FALSE); drupal_goto(''); return ""; diff --git a/booking.paypal.inc b/booking.paypal.inc index e7cdaac..8793df3 100644 --- a/booking.paypal.inc +++ b/booking.paypal.inc @@ -32,7 +32,7 @@ function _booking_paypal_ipn_verify($vars = array()) { curl_close($ch); ob_end_clean(); - if (('/VERIFIED/i', $info)) { + if (preg_match('/VERIFIED/i', $info)) { watchdog('booking', 'Payment verification completed successfully: @info', array('@info' => $info)); return TRUE; } diff --git a/booking.prices.inc b/booking.prices.inc index 4b6fbf0..7c368bd 100644 --- a/booking.prices.inc +++ b/booking.prices.inc @@ -115,7 +115,7 @@ function booking_price_form($node, &$form_state, $create, $editid = 0) else { //verify that $editid is a number - if (! ('/^[0-9]+$/', $editid)) { + if preg_match(! ('/^[0-9]+$/', $editid)) { drupal_set_message("Error: Invalid price ID supplied. Unable to update price entry.", 'error', FALSE); drupal_goto('admin/config/booking/prices'); return ""; @@ -240,7 +240,7 @@ function booking_price_form_submit($form, &$form_state) { elseif ($form_state['values']['op'] == 'Delete') { //verify that booking_pid is a number - if (! ('/^[0-9]+$/', $values['booking_pid'])) { + if (! preg_match('/^[0-9]+$/', $values['booking_pid'])) { drupal_set_message("Error: Invalid price ID supplied. Unable to delete price entry.", 'error', FALSE); return ""; } diff --git a/booking.reports.inc b/booking.reports.inc index 9b83f0e..b09afef 100644 --- a/booking.reports.inc +++ b/booking.reports.inc @@ -707,7 +707,7 @@ function booking_csv_report() { $output[] = _booking_status_generate($value); continue; } - ygroup session roles + //studygroup ygroup session roles if (preg_match("/session\d+_role/", $key)) { $output[] = _booking_studygroup_role_lookup($value); diff --git a/booking.rooms.inc b/booking.rooms.inc index 793d373..c5ee807 100644 --- a/booking.rooms.inc +++ b/booking.rooms.inc @@ -130,7 +130,7 @@ function booking_room_edit_form($node, &$form_state, $nid) { $location_options[] = "--"; //verify that $nid is a number - if (! ('/^[0-9]+$/', $nid)) { + if (! preg_match('/^[0-9]+$/', $nid)) { drupal_set_message("Error: Invalid registration ID '" . $nid . "' supplied. Unable to edit study group sessions.", 'error', FALSE); drupal_goto('admin/booking/rooms'); return ""; @@ -449,7 +449,7 @@ function booking_rooms_allocate_form($node, &$form_state, $location_id) { $counter = 0; //verify that $location_id is a number - if (! ('/^[0-9]+$/', $location_id)) { + if (! preg_match('/^[0-9]+$/', $location_id)) { drupal_set_message("Error: Invalid room location ID '" . $location_id . "' supplied. Unable to allocate rooms.", 'error', FALSE); drupal_goto('admin/booking/rooms'); return ""; @@ -817,7 +817,7 @@ function booking_rooms_view_form($node, &$form_state, $location_id) { $form = array(); //verify that $location_id is a number - if (! ('/^[0-9]+$/', $location_id)) { + if (! preg_match('/^[0-9]+$/', $location_id)) { drupal_set_message("Error: Invalid room location ID '" . $location_id . "' supplied. Unable to allocate rooms.", 'error', FALSE); drupal_goto('admin/booking/rooms'); diff --git a/booking.rooms_admin.inc b/booking.rooms_admin.inc index 3afecf0..210c894 100644 --- a/booking.rooms_admin.inc +++ b/booking.rooms_admin.inc @@ -64,7 +64,7 @@ function booking_roomlocation_define_form($node, &$form_state, $create, $editid { drupal_set_title('Edit Room Location'); //verify that $editid is a number - if (! ('/^[0-9]+$/', $editid)) { + if (! preg_match('/^[0-9]+$/', $editid)) { drupal_set_message("Error: Invalid room location ID supplied. Unable to edit room location definition.", 'error', FALSE); drupal_goto('admin/config/booking/rooms'); return ""; @@ -177,7 +177,7 @@ function booking_roomlocation_define_form_submit($form, &$form_state) { elseif ($form_state['values']['op'] == 'Delete') { //verify that booking_lid is a number - if (! ('/^[0-9]+$/', $values['booking_lid'])) { + if (! preg_match('/^[0-9]+$/', $values['booking_lid'])) { drupal_set_message("Error: Invalid room location ID supplied. Unable to delete entry.", 'error', FALSE); return ""; } @@ -191,8 +191,8 @@ function booking_roomlocation_define_form_submit($form, &$form_state) { elseif ($form_state['values']['op'] == 'Update') { - //verify that booking_sid is a number - if (! ('/^[0-9]+$/', $values['booking_lid'])) { + //verify that booking_lid is a number + if (! preg_match('/^[0-9]+$/', $values['booking_lid'])) { drupal_set_message("Error: Invalid room location ID supplied. Unable to update room location definition.", 'error', FALSE); return ""; } @@ -335,7 +335,7 @@ function booking_rooms_definition_form($node, &$form_state, $create, $room_id = else { //verify that $editid is a number - if (! ('/^[0-9]+$/', $room_id)) { + if (! preg_match('/^[0-9]+$/', $room_id)) { drupal_set_message("Error: Invalid room ID supplied. Unable to update room definition.", 'error', FALSE); drupal_goto('admin/config/booking/rooms'); return ""; diff --git a/booking.studygroups.inc b/booking.studygroups.inc index 1276ef9..f1414c4 100644 --- a/booking.studygroups.inc +++ b/booking.studygroups.inc @@ -26,7 +26,7 @@ function booking_available_leadhelp_select_form($node, &$form_state, $group_id) ); //verify that $group_id is a number - if (! ('/^[0-9]+$/', $group_id)) { + if (! preg_match('/^[0-9]+$/', $group_id)) { drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to edit group leaders and helpers.", 'error', FALSE); drupal_goto('admin/booking/studygroups'); return ""; @@ -383,7 +383,7 @@ function booking_studygroups_edit_form($node, &$form_state, $nid) { $readinggroup_options[0] = ''; //verify that $nid is a number - if (! ('/^[0-9]+$/', $nid)) { + if (! preg_match('/^[0-9]+$/', $nid)) { drupal_set_message("Error: Invalid registration ID '" . $nid . "' supplied. Unable to edit study group sessions.", 'error', FALSE); drupal_goto('admin/booking/studygroups'); return ""; @@ -522,7 +522,7 @@ function booking_studygroups_edit_form_submit($form, &$form_state) { $values = $form_state['input']; //check that $values['personid'] is a number - if (! ('/^[0-9]+$/', $values['personid'])) { + if (! preg_match('/^[0-9]+$/', $values['personid'])) { //parameter from url is not what we were expecting drupal_set_message("Error: Invalid form data supplied. Please use the contact us form to let us know.", 'error', FALSE); return ""; @@ -979,7 +979,7 @@ function booking_studygroups_update_form($node, &$form_state, $sid) { $inserts_to_confirm = array(); //verify that $nid is a number - if (! ('/^[0-9]+$/', $sid)) { + if (! preg_match('/^[0-9]+$/', $sid)) { drupal_set_message("Error: Invalid group ID '" . $sid . "' supplied. Unable to update study group session.", 'error', FALSE); drupal_goto('admin/booking/studygroups'); return ""; @@ -1484,7 +1484,7 @@ function booking_studygroups_printview_form($node, &$form_state, $group_id) { //verify that $group_id is a number - if (! ('/^[0-9]+$/', $group_id)) { + if (! preg_match('/^[0-9]+$/', $group_id)) { drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to view group membership.", 'error', FALSE); drupal_goto('admin/config/booking'); return ""; @@ -1612,7 +1612,7 @@ function booking_studygroups_view_form($node, &$form_state, $group_id) { ); */ //verify that $group_id is a number - if (! ('/^[0-9]+$/', $group_id)) { + if (! preg_match('/^[0-9]+$/', $group_id)) { drupal_set_message("Error: Invalid study group ID '" . $group_id . "' supplied. Unable to view group membership.", 'error', FALSE); drupal_goto('admin/config/booking'); return ""; diff --git a/booking.studygroups_admin.inc b/booking.studygroups_admin.inc index 6f4ed89..739128c 100644 --- a/booking.studygroups_admin.inc +++ b/booking.studygroups_admin.inc @@ -96,7 +96,7 @@ function booking_studygroups_define_form($node, &$form_state, $create, $editid = { drupal_set_title('Edit Study Group'); //verify that $editid is a number - if (! ('/^[0-9]+$/', $editid)) { + if (! preg_match('/^[0-9]+$/', $editid)) { drupal_set_message("Error: Invalid study group ID supplied. Unable to edit study group definition.", 'error', FALSE); drupal_goto('admin/booking/config/studygroups'); return ""; @@ -220,7 +220,7 @@ function booking_studygroups_define_form_submit($form, &$form_state) { elseif ($form_state['values']['op'] == 'Delete Study Group Definition') { //verify that booking_pid is a number - if (! ('/^[0-9]+$/', $values['booking_sid'])) { + if (! preg_match('/^[0-9]+$/', $values['booking_sid'])) { drupal_set_message("Error: Invalid studygroup ID supplied. Unable to delete entry.", 'error', FALSE); return ""; } @@ -238,7 +238,7 @@ function booking_studygroups_define_form_submit($form, &$form_state) { { //verify that booking_sid is a number - if (! ('/^[0-9]+$/', $values['booking_sid'])) { + if (! preg_match('/^[0-9]+$/', $values['booking_sid'])) { drupal_set_message("Error: Invalid studygroup ID supplied. Unable to update study group.", 'error', FALSE); return ""; } diff --git a/booking.travel.inc b/booking.travel.inc index 7f2dac0..7565084 100644 --- a/booking.travel.inc +++ b/booking.travel.inc @@ -9,7 +9,7 @@ function booking_travel_page() { $return_array = array(); //verify that arg(1) is a uuid - if (! ('/^[0-9A-Fa-f\-]+$/', arg(1))) { + if (! preg_match('/^[0-9A-Fa-f\-]+$/', arg(1))) { //parameter from url is not what we were expecting drupal_set_message("Error: Invalid session ID supplied. Please use the contact us form to let us know.", 'error', FALSE); return ""; @@ -418,7 +418,7 @@ function travel_form_submit($form, &$form_state) { //watchdog('booking', 'Submitting travel form: @info', array('@info' => var_export($values, TRUE))); //check that $values['personid'] is a number - if (! ('/^[0-9]+$/', $values['personid'])) { + if (! preg_match('/^[0-9]+$/', $values['personid'])) { //parameter from url is not what we were expecting drupal_set_message("Error: Invalid form data supplied. Please use the contact us form to let us know.", 'error', FALSE); return ""; diff --git a/booking.variety.inc b/booking.variety.inc index 1a7f3d6..2af46c9 100644 --- a/booking.variety.inc +++ b/booking.variety.inc @@ -76,7 +76,7 @@ function booking_variety_timeslot_form($node, &$form_state, $create, $editid = 0 else { //verify that $editid is a number - if (! ('/^[0-9]+$/', $editid)) { + if (! preg_match('/^[0-9]+$/', $editid)) { drupal_set_message("Error: Invalid variety ID supplied. Unable to update variety session information.", 'error', FALSE); drupal_goto('admin/config/booking/variety'); return ""; @@ -177,7 +177,7 @@ function booking_variety_timeslot_form_submit($form, &$form_state) { elseif ($form_state['values']['op'] == 'Delete') { //verify that tid is a number - if (! ('/^[0-9]+$/', $values['tid'])) { + if (! preg_match('/^[0-9]+$/', $values['tid'])) { drupal_set_message("Error: Invalid variety timeslot ID supplied. Unable to delete entry.", 'error', FALSE); return ""; } @@ -193,7 +193,7 @@ function booking_variety_timeslot_form_submit($form, &$form_state) { else { //verify that booking_eid is a number - if (! ('/^[0-9]+$/', $values['tid'])) { + if (! preg_match('/^[0-9]+$/', $values['tid'])) { drupal_set_message("Error: Invalid variety session timeslot ID supplied. Unable to update entry.", 'error', FALSE); return ""; } @@ -222,7 +222,7 @@ function booking_variety_create_session_form($node, &$form_state, $timeslot_id = $data = $node; //verify that $editid is a number - if (! ('/^[0-9]+$/', $timeslot_id)) { + if (! preg_match('/^[0-9]+$/', $timeslot_id)) { drupal_set_message("Error: Invalid variety ID supplied. Unable to update variety session information.", 'error', FALSE); drupal_goto('admin/config/booking/variety'); return ""; @@ -307,7 +307,7 @@ function booking_variety_list_session_form($node, &$form_state, $timeslot_id = 0 $data = $node; //verify that $editid is a number - if (! ('/^[0-9]+$/', $timeslot_id)) { + if (! preg_match('/^[0-9]+$/', $timeslot_id)) { drupal_set_message("Error: Invalid variety ID supplied. Unable to select variety session information.", 'error', FALSE); drupal_goto('admin/config/booking/variety'); return "";