|
@@ -47,18 +47,14 @@ if (!empty($_GET['setdefault'])) {
|
47
|
47
|
$DB->query("
|
48
|
48
|
SELECT SiteOptions
|
49
|
49
|
FROM users_info
|
50
|
|
- WHERE UserID = '".db_string($LoggedUser['ID'])."'");
|
|
50
|
+ WHERE UserID = ?", $LoggedUser['ID']);
|
51
|
51
|
list($SiteOptions) = $DB->next_record(MYSQLI_NUM, false);
|
52
|
|
- if (!empty($SiteOptions)) {
|
53
|
|
- $SiteOptions = unserialize($SiteOptions);
|
54
|
|
- } else {
|
55
|
|
- $SiteOptions = [];
|
56
|
|
- }
|
|
52
|
+ $SiteOptions = json_decode($SiteOptions, true) ?? [];
|
57
|
53
|
$SiteOptions['DefaultSearch'] = preg_replace($UnsetRegexp, '', $_SERVER['QUERY_STRING']);
|
58
|
54
|
$DB->query("
|
59
|
55
|
UPDATE users_info
|
60
|
|
- SET SiteOptions = '".db_string(serialize($SiteOptions))."'
|
61
|
|
- WHERE UserID = '".db_string($LoggedUser['ID'])."'");
|
|
56
|
+ SET SiteOptions = ?
|
|
57
|
+ WHERE UserID = ?", json_encode($SiteOptions), $LoggedUser['ID']);
|
62
|
58
|
$Cache->begin_transaction("user_info_heavy_$UserID");
|
63
|
59
|
$Cache->update_row(false, ['DefaultSearch' => $SiteOptions['DefaultSearch']]);
|
64
|
60
|
$Cache->commit_transaction(0);
|
|
@@ -68,14 +64,14 @@ if (!empty($_GET['setdefault'])) {
|
68
|
64
|
$DB->query("
|
69
|
65
|
SELECT SiteOptions
|
70
|
66
|
FROM users_info
|
71
|
|
- WHERE UserID = '".db_string($LoggedUser['ID'])."'");
|
|
67
|
+ WHERE UserID = ?", $LoggedUser['ID']);
|
72
|
68
|
list($SiteOptions) = $DB->next_record(MYSQLI_NUM, false);
|
73
|
|
- $SiteOptions = unserialize($SiteOptions);
|
|
69
|
+ $SiteOptions = json_decode($SiteOptions, true) ?? [];
|
74
|
70
|
$SiteOptions['DefaultSearch'] = '';
|
75
|
71
|
$DB->query("
|
76
|
72
|
UPDATE users_info
|
77
|
|
- SET SiteOptions = '".db_string(serialize($SiteOptions))."'
|
78
|
|
- WHERE UserID = '".db_string($LoggedUser['ID'])."'");
|
|
73
|
+ SET SiteOptions = ?
|
|
74
|
+ WHERE UserID = ?", json_encode($SiteOptions), $LoggedUser['ID']);
|
79
|
75
|
$Cache->begin_transaction("user_info_heavy_$UserID");
|
80
|
76
|
$Cache->update_row(false, ['DefaultSearch' => '']);
|
81
|
77
|
$Cache->commit_transaction(0);
|