diff --git a/libraries/db_common.inc.php b/libraries/db_common.inc.php index d7a829f610..dee9ffcaf9 100644 --- a/libraries/db_common.inc.php +++ b/libraries/db_common.inc.php @@ -139,6 +139,18 @@ if (isset($_POST['submitcollation']) $response->addJSON('message', $message); exit; } +} elseif (isset($_POST['submitcollation']) + && isset($_POST['db_collation']) + && empty($_POST['db_collation']) +) { + $response = Response::getInstance(); + if ($response->isAjax()) { + $response->setRequestStatus(false); + $response->addJSON( + 'message', + Message::error(__('No collation provided.')) + ); + } } /** diff --git a/tbl_operations.php b/tbl_operations.php index 4ff5ab9d69..5ce82ee175 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -214,6 +214,18 @@ if (isset($_POST['submitoptions'])) { $GLOBALS['db'], $GLOBALS['table'], $_POST['tbl_collation'] ); } + + if (isset($_POST['tbl_collation']) && empty($_POST['tbl_collation'])) { + $response = Response::getInstance(); + if ($response->isAjax()) { + $response->setRequestStatus(false); + $response->addJSON( + 'message', + Message::error(__('No collation provided.')) + ); + exit; + } + } } /** * Reordering the table has been requested by the user