store userprefs using JSON instead of serialized PHP array
This commit is contained in:
@@ -68,8 +68,9 @@ function PMA_load_userprefs()
|
|||||||
FROM ' . $query_table . '
|
FROM ' . $query_table . '
|
||||||
WHERE `username` = \'' . PMA_sqlAddslashes($cfgRelation['user']) . '\'';
|
WHERE `username` = \'' . PMA_sqlAddslashes($cfgRelation['user']) . '\'';
|
||||||
$row = PMA_DBI_fetch_single_row($query, 'ASSOC', $GLOBALS['controllink']);
|
$row = PMA_DBI_fetch_single_row($query, 'ASSOC', $GLOBALS['controllink']);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'config_data' => $row ? unserialize($row['config_data']) : array(),
|
'config_data' => $row ? (array)json_decode($row['config_data']) : array(),
|
||||||
'mtime' => $row ? $row['ts'] : time(),
|
'mtime' => $row ? $row['ts'] : time(),
|
||||||
'type' => 'db');
|
'type' => 'db');
|
||||||
}
|
}
|
||||||
@@ -122,7 +123,7 @@ function PMA_save_userprefs(array $config_array)
|
|||||||
WHERE `username` = \'' . PMA_sqlAddslashes($cfgRelation['user']) . '\'';
|
WHERE `username` = \'' . PMA_sqlAddslashes($cfgRelation['user']) . '\'';
|
||||||
|
|
||||||
$has_config = PMA_DBI_fetch_value($query, 0, 0, $GLOBALS['controllink']);
|
$has_config = PMA_DBI_fetch_value($query, 0, 0, $GLOBALS['controllink']);
|
||||||
$config_data = serialize($config_array);
|
$config_data = json_encode($config_array);
|
||||||
if ($has_config) {
|
if ($has_config) {
|
||||||
$query = '
|
$query = '
|
||||||
UPDATE ' . $query_table . '
|
UPDATE ' . $query_table . '
|
||||||
|
Reference in New Issue
Block a user