]> git.wh0rd.org - tt-rss.git/commitdiff
fix USER_STYLESHEET for mysql (was broken because of CR escaping
authorAndrew Dolgov <fox@fakecake.org>
Tue, 28 Dec 2010 06:11:49 +0000 (09:11 +0300)
committerAndrew Dolgov <fox@fakecake.org>
Tue, 28 Dec 2010 06:11:49 +0000 (09:11 +0300)
functions.php
modules/backend-rpc.php
modules/popup-dialog.php

index 3928b2a348d87179469ae7e31bbbfc605562f48c..b2694f7ecbb51a2bd1c1c897caf988c23d5dcc01 100644 (file)
 
                if ($value) {
                        print "<style type=\"text/css\">";
-                       print $value;
+                       print str_replace("<br/>", "\n", $value);
                        print "</style>";
                }
 
index 1447634bf6a3ad55973d420d609b0efa8998d1ac..947dd5c50e9de3da44820004696965e906303380 100644 (file)
                if ($subop == "setpref") {
                        header("Content-Type: text/plain");
 
+                       $value = str_replace("\n", "<br/>", $_REQUEST['value']);
+
                        $key = db_escape_string($_REQUEST["key"]);
-                       $value = db_escape_string($_REQUEST["value"]);
+                       $value = db_escape_string($value);
 
                        set_pref($link, $key, $value);
 
index d9de6ab53e9b22c770bd7d3ccb4da22b863eda2f..bc206be076aa1e79fa146cf076bb19e0086e1982 100644 (file)
 
                        $value = get_pref($link, "USER_STYLESHEET");
 
+                       $value = str_replace("<br/>", "\n", $value);
+
                        print T_sprintf("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target=\"_blank\" class=\"visibleLink\" href=\"%s\">This file</a> can be used as a baseline.", "tt-rss.css");
 
                        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";