From 5d7f7abf3c7c92f1e3080c3446869d1576b12dd4 Mon Sep 17 00:00:00 2001 From: Michel Mendiola Date: Tue, 24 Dec 2024 10:43:26 -0600 Subject: [PATCH] fix: str_contains is only available since PHP 8 --- Sources/Subs-Db-mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Subs-Db-mysql.php b/Sources/Subs-Db-mysql.php index 34254851d4..f324baa61d 100644 --- a/Sources/Subs-Db-mysql.php +++ b/Sources/Subs-Db-mysql.php @@ -844,7 +844,7 @@ function smf_db_insert($method, $table, $columns, $data, $keys, $returnmode = 0, foreach ($columns as $column_name => $type) { - if (str_contains($type, 'string-')) + if (strpos($type, 'string-') !== false) $where_string[] = $column_name . ' = ' . sprintf('SUBSTRING({string:%1$s}, 1, ' . substr($type, 7) . ')', $column_name); else $where_string[] = $column_name . ' = ' . sprintf('{%1$s:%2$s}', $type, $column_name);