fixes #4434 Disable special column names starting without underscore
Compare changes
Some changes are not shown
For a faster browsing experience, some files are collapsed by default.
Files
4@@ -134,7 +134,7 @@ class DatabaseUpdate {
@@ -134,7 +134,7 @@ class DatabaseUpdate {
@@ -165,7 +165,7 @@ class DatabaseUpdate {
@@ -165,7 +165,7 @@ class DatabaseUpdate {
* Check if there are special columns without prepended underscore in the QFQ application. If yes, then throw an error.
@@ -173,68 +173,33 @@ class DatabaseUpdate {
@@ -173,68 +173,33 @@ class DatabaseUpdate {
$actionSpecialColumn = $_GET[ACTION_SPECIAL_COLUMN_UPDATE] ?? ''; // get parameter to decide whether to execute the replacement
$res = $this->db->sql("SELECT * FROM " . $dbT3 . ".tt_content WHERE CType='qfq_qfq' AND deleted=0;");
$replaced_placeholder = preg_replace($patterns, '${1}' . $placeholder . '${2}', $tt_content['bodytext']);
$query = "UPDATE " . $dbT3 . ".tt_content SET bodytext='" . addslashes($replace) . "' WHERE uid='" . $tt_content['uid'] . "'";
@@ -246,62 +211,56 @@ class DatabaseUpdate {
@@ -246,62 +211,56 @@ class DatabaseUpdate {
$res = $this->db->sql("SELECT * FROM FormElement as fe WHERE fe.type='note' AND fe.value LIKE '%#!report%' OR fe.note LIKE '%#!report%';");
$replaced_placeholder = preg_replace($patterns, '${1}' . $placeholder . '${2}', $tt_content['value']);
$query = "UPDATE FormElement SET value='" . addslashes($replace) . "' WHERE id='" . $tt_content['id'] . "'";
$message_ttc .= '<hr><b>' . $tt_content['name'] . ' [id:' . $tt_content['id'] . '] (FormElement.value)</b><br><br>';
$replaced_placeholder = preg_replace($patterns, '${1}' . $placeholder . '${2}', $tt_content['note']);
$query = "UPDATE FormElement SET note='" . addslashes($replace) . "' WHERE id='" . $tt_content['id'] . "'";
$message_ttc .= '<hr><b>' . $tt_content['name'] . ' [id:' . $tt_content['id'] . '] (FormElement.note)</b><br><br>';
$message = '<h1>Special column names replaced</h1>The following special column names were replaced.<hr>' . $message;
Logger::logMessage($message, SYSTEM_FILEADMIN_PROTECTED_LOG . '/' . date("YmdHi") . '_special_columns_auto_update.html');
. '<a href="?' . http_build_query(array_merge($_GET, array(ACTION_SPECIAL_COLUMN_UPDATE => ACTION_SPECIAL_COLUMN_REPLACE))) . '">Click here</a>'
. ' In the report bellow the missing underscores are marked by "<span style="font-weight: bold; color: red;">>>>_</span>".'
. ' This report will be saved in ' . SYSTEM_FILEADMIN_PROTECTED_LOG . ' after the automatic replacement.'