diff --git a/db_qbe.php b/db_qbe.php index 135ba7ec76..e1f172a3fb 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -90,7 +90,7 @@ if ($cfgRelation['savedsearcheswork']) { */ $message_to_display = false; if (isset($_POST['submit_sql']) && ! empty($sql_query)) { - if (! preg_match('@^SELECT@i', $sql_query)) { + if (0 !== stripos($sql_query, "SELECT")) { $message_to_display = true; } else { $goto = 'db_sql.php'; diff --git a/index.php b/index.php index c5f74977d3..758ea62031 100644 --- a/index.php +++ b/index.php @@ -62,7 +62,7 @@ $target_blacklist = [ // If we have a valid target, let's load that script instead if (! empty($_REQUEST['target']) && is_string($_REQUEST['target']) - && ! preg_match('/^index/', $_REQUEST['target']) + && 0 !== strpos($_REQUEST['target'], "index") && ! in_array($_REQUEST['target'], $target_blacklist) && Core::checkPageValidity($_REQUEST['target'], [], true) ) { diff --git a/libraries/classes/Controllers/Table/TableSearchController.php b/libraries/classes/Controllers/Table/TableSearchController.php index 366b65698a..6ede4081f7 100644 --- a/libraries/classes/Controllers/Table/TableSearchController.php +++ b/libraries/classes/Controllers/Table/TableSearchController.php @@ -158,7 +158,7 @@ class TableSearchController extends TableController // strip the "BINARY" attribute, except if we find "BINARY(" because // this would be a BINARY or VARBINARY column type if (! preg_match('@BINARY[\(]@i', $type)) { - $type = preg_replace('@BINARY@i', '', $type); + $type = str_ireplace("BINARY", '', $type); } $type = preg_replace('@ZEROFILL@i', '', $type); $type = preg_replace('@UNSIGNED@i', '', $type); diff --git a/libraries/classes/InsertEdit.php b/libraries/classes/InsertEdit.php index 9fa2ec60b3..9b63f5f5ea 100644 --- a/libraries/classes/InsertEdit.php +++ b/libraries/classes/InsertEdit.php @@ -3002,7 +3002,7 @@ class InsertEdit 'sql_query' => $_POST['sql_query'], ]; - if (preg_match('@^tbl_@', $GLOBALS['goto'])) { + if (0 === strpos($GLOBALS['goto'], "tbl_")) { $url_params['table'] = $table; } diff --git a/libraries/classes/Relation.php b/libraries/classes/Relation.php index 60bfe8a967..b0fc3d8a14 100644 --- a/libraries/classes/Relation.php +++ b/libraries/classes/Relation.php @@ -1280,7 +1280,7 @@ class Relation $key = htmlspecialchars($key); } else { $key = '0x' . bin2hex($key); - if (preg_match('/0x/', $data)) { + if (false !== strpos($data, "0x")) { $selected = ($key == trim($data)); } else { $selected = ($key == '0x' . $data); diff --git a/libraries/classes/SysInfoSunOS.php b/libraries/classes/SysInfoSunOS.php index 20eabb08f1..030cee055e 100644 --- a/libraries/classes/SysInfoSunOS.php +++ b/libraries/classes/SysInfoSunOS.php @@ -30,7 +30,7 @@ class SysInfoSunOS extends SysInfoBase private function _kstat($key) { if ($m = shell_exec('kstat -p d ' . $key)) { - list(, $value) = preg_split("/\t/", trim($m), 2); + list(, $value) = explode("\t", trim($m), 2); return $value; } else { diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php index 597aeb7473..8cda6158f8 100644 --- a/libraries/classes/Table.php +++ b/libraries/classes/Table.php @@ -526,7 +526,7 @@ class Table $query .= ' ' . $attribute; if ($is_timestamp - && preg_match('/TIMESTAMP/i', $attribute) + && false !== stripos($attribute, "TIMESTAMP") && strlen($length) !== 0 && $length !== 0 ) { diff --git a/libraries/classes/Transformations.php b/libraries/classes/Transformations.php index 7036d61e09..a1acfbc013 100644 --- a/libraries/classes/Transformations.php +++ b/libraries/classes/Transformations.php @@ -53,7 +53,7 @@ class Transformations $result = []; if (strlen($option_string) === 0 - || ! $transform_options = preg_split('/,/', $option_string) + || ! $transform_options = explode(",", $option_string) ) { return $result; } diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php index 47a1dcf86f..e0927a69ae 100644 --- a/libraries/classes/Util.php +++ b/libraries/classes/Util.php @@ -2894,7 +2894,7 @@ class Util // this would be a BINARY or VARBINARY column type; // by the way, a BLOB should not show the BINARY attribute // because this is not accepted in MySQL syntax. - if (preg_match('@binary@', $printtype) + if (false !== strpos($printtype, "binary") && ! preg_match('@binary[\(]@', $printtype) ) { $printtype = preg_replace('@binary@', '', $printtype);