Commit b5c56be3 authored by Dries's avatar Dries

- Made it possible to store arrays in the variables table.  Patch by Marco.
parent 118da4b7
......@@ -146,7 +146,7 @@ function variable_init($conf = array()) {
$result = db_query("SELECT * FROM variable");
while ($variable = db_fetch_object($result)) {
if (!isset($conf[$variable->name])) {
$conf[$variable->name] = $variable->value;
$conf[$variable->name] = unserialize($variable->value);
}
}
......@@ -163,7 +163,7 @@ function variable_set($name, $value) {
global $conf;
db_query("DELETE FROM variable WHERE name = '%s'", $name);
db_query("INSERT INTO variable (name, value) VALUES ('%s', '%s')", $name, $value);
db_query("INSERT INTO variable (name, value) VALUES ('%s', '%s')", $name, serialize($value));
$conf[$name] = $value;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment