mirror of
https://github.com/itflow-org/itflow
synced 2026-06-02 16:18:19 +00:00
- Prevent error 500s when existing data can't be cleanly re-inserted to database
This commit is contained in:
@@ -5,7 +5,7 @@ define('number_regex', '/[^0-9]/');
|
||||
if (isset($_POST['contact_name'])) {
|
||||
$name = sanitizeInput($_POST['contact_name']);
|
||||
} elseif ($contact_row) {
|
||||
$name = $contact_row['contact_name'];
|
||||
$name = mysqli_real_escape_string($mysqli, $contact_row['contact_name']);
|
||||
} else {
|
||||
$name = '';
|
||||
}
|
||||
@@ -13,7 +13,7 @@ if (isset($_POST['contact_name'])) {
|
||||
if (isset($_POST['contact_title'])) {
|
||||
$title = sanitizeInput($_POST['contact_title']);
|
||||
} elseif ($contact_row) {
|
||||
$title = $contact_row['contact_title'];
|
||||
$title = mysqli_real_escape_string($mysqli, $contact_row['contact_title']);
|
||||
} else {
|
||||
$title = '';
|
||||
}
|
||||
@@ -21,7 +21,7 @@ if (isset($_POST['contact_title'])) {
|
||||
if (isset($_POST['contact_department'])) {
|
||||
$department = sanitizeInput($_POST['contact_department']);
|
||||
} elseif ($contact_row) {
|
||||
$department = $contact_row['contact_department'];
|
||||
$department = mysqli_real_escape_string($mysqli, $contact_row['contact_department']);
|
||||
} else {
|
||||
$department = '';
|
||||
}
|
||||
@@ -29,7 +29,7 @@ if (isset($_POST['contact_department'])) {
|
||||
if (isset($_POST['contact_email'])) {
|
||||
$email = sanitizeInput($_POST['contact_email']);
|
||||
} elseif ($contact_row) {
|
||||
$email = $contact_row['contact_email'];
|
||||
$email = mysqli_real_escape_string($mysqli, $contact_row['contact_email']);
|
||||
} else {
|
||||
$email = '';
|
||||
}
|
||||
@@ -37,7 +37,7 @@ if (isset($_POST['contact_email'])) {
|
||||
if (isset($_POST['contact_phone'])) {
|
||||
$phone = preg_replace(number_regex, '', $_POST['contact_phone']);
|
||||
} elseif ($contact_row) {
|
||||
$phone = $contact_row['contact_phone'];
|
||||
$phone = mysqli_real_escape_string($mysqli, $contact_row['contact_phone']);
|
||||
} else {
|
||||
$phone = '';
|
||||
}
|
||||
@@ -45,7 +45,7 @@ if (isset($_POST['contact_phone'])) {
|
||||
if (isset($_POST['contact_extension'])) {
|
||||
$extension = preg_replace(number_regex, '', $_POST['contact_extension']);
|
||||
} elseif ($contact_row) {
|
||||
$extension = $contact_row['contact_extension'];
|
||||
$extension = mysqli_real_escape_string($mysqli, $contact_row['contact_extension']);
|
||||
} else {
|
||||
$extension = '';
|
||||
}
|
||||
@@ -53,7 +53,7 @@ if (isset($_POST['contact_extension'])) {
|
||||
if (isset($_POST['contact_mobile'])) {
|
||||
$mobile = preg_replace(number_regex, '', $_POST['contact_mobile']);
|
||||
} elseif ($contact_row) {
|
||||
$mobile = $contact_row['contact_mobile'];
|
||||
$mobile = mysqli_real_escape_string($mysqli, $contact_row['contact_mobile']);
|
||||
} else {
|
||||
$mobile = '';
|
||||
}
|
||||
@@ -61,7 +61,7 @@ if (isset($_POST['contact_mobile'])) {
|
||||
if (isset($_POST['contact_notes'])) {
|
||||
$notes = sanitizeInput($_POST['contact_notes']);
|
||||
} elseif ($contact_row) {
|
||||
$notes = $contact_row['contact_notes'];
|
||||
$notes = mysqli_real_escape_string($mysqli, $contact_row['contact_notes']);
|
||||
} else {
|
||||
$notes = '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user