Fix preg_match fail
This commit is contained in:
@@ -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('<front>');
|
||||
|
@@ -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('<front>');
|
||||
@@ -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 "";
|
||||
|
@@ -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 "";
|
||||
}
|
||||
|
@@ -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('<front>');
|
||||
@@ -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('<front>');
|
||||
return "";
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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 "";
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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');
|
||||
|
@@ -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 "";
|
||||
|
@@ -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 "";
|
||||
|
@@ -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 "";
|
||||
}
|
||||
|
@@ -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 "";
|
||||
|
@@ -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 "";
|
||||
|
Reference in New Issue
Block a user