fix customize CSS dialog disappearing newlines
This commit is contained in:
parent
86edc737f4
commit
0380cfa9ee
|
@ -212,10 +212,9 @@ class RPC extends Protected_Handler {
|
||||||
function setpref() {
|
function setpref() {
|
||||||
$value = str_replace("\n", "<br/>", $_REQUEST['value']);
|
$value = str_replace("\n", "<br/>", $_REQUEST['value']);
|
||||||
|
|
||||||
$key = db_escape_string($_REQUEST["key"]);
|
// set_pref escapes input, so no need to double escape it here
|
||||||
$value = db_escape_string($value);
|
|
||||||
|
|
||||||
set_pref($this->link, $key, $value);
|
set_pref($this->link, $key, $value, $_SESSION['uid'], false);
|
||||||
|
|
||||||
print json_encode(array("param" =>$key, "value" => $value));
|
print json_encode(array("param" =>$key, "value" => $value));
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,9 +79,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_pref($link, $pref_name, $value, $user_id = false) {
|
function set_pref($link, $pref_name, $value, $user_id = false, $strip_tags = true) {
|
||||||
$pref_name = db_escape_string($pref_name);
|
$pref_name = db_escape_string($pref_name);
|
||||||
$value = db_escape_string($value);
|
$value = db_escape_string($value, $strip_tags);
|
||||||
|
|
||||||
if (!$user_id) {
|
if (!$user_id) {
|
||||||
$user_id = $_SESSION["uid"];
|
$user_id = $_SESSION["uid"];
|
||||||
|
|
Loading…
Reference in New Issue