- // Free memory
- SQL_FREERESULT($result);
- }
- break;
-
- case "pass1":
- $k = ""; $v = "";
- break;
-
- case "pass2":
- $k = "password"; $v = md5($v);
- break;
-
- case "url":
- if (!VALIDATE_URL($v)) $SAVE = false;
- break;
-
- default:
- // Test if there is are time selections
- $TEST = substr($k, -3);
- if ((($TEST == "_ye") || ($TEST == "_mo") || ($TEST == "_we") || ($TEST == "_da") || ($TEST == "_ho") || ($TEST == "_mi") || ($TEST == "_se")) && (!empty($v))) {
- // Found a multi-selection for timings?
- $TEST = substr($k, 0, -3);
- if ((!empty($POST[$TEST."_ye"])) && (!empty($POST[$TEST."_mo"])) && (!empty($POST[$TEST."_we"])) && (!empty($POST[$TEST."_da"])) && (!empty($POST[$TEST."_ho"])) && (!empty($POST[$TEST."_mi"])) && (!empty($POST[$TEST."_se"])) && ($TEST != $TEST2)) {
- // Generate timestamp
- $POST[$TEST] = CREATE_TIMESTAMP_FROM_SELECTIONS($TEST, $POST);
- $DATA['keys'][] = $TEST;
- $DATA['values'][] = $POST[$TEST];
-
- // Remove data from array
- // @TODO Do we still need this all?
- unset($POST[$TEST."_ye"]);
- unset($POST[$TEST."_mo"]);
- unset($POST[$TEST."_we"]);
- unset($POST[$TEST."_da"]);
- unset($POST[$TEST."_ho"]);
- unset($POST[$TEST."_mi"]);
- unset($POST[$TEST."_se"]);
-
- // Skip adding
- $k = ""; $skip = true; $TEST2 = $TEST;
- }
- } else {
- $skip = false; $TEST2 = "";
+ case 'pass1':
+ $k = ''; $v = '';
+ break;
+
+ case 'pass2':
+ $k = 'password'; $v = md5($v);
+ break;
+
+ case 'url':
+ if (!isUrlValid($v)) $SAVE = false;
+ break;
+
+ default:
+ // Test if there is are time selections
+ convertSelectionsToTimestamp($postData, $DATA, $k, $skip);
+ break;