X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=classes%2Fpref%2Fprefs.php;h=0ae3e1bbb795a84b2b53a5b35eb10eb79971c019;hb=81fc862e370a1dfbd3941206fd00076e3cbf0551;hp=ab39b1e286d8c49a7146f1e3c70c11de21596372;hpb=e4291ba12f1a48ab4514d17720c93a660af2ebdd;p=tt-rss.git diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index ab39b1e2..0ae3e1bb 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -48,7 +48,7 @@ class Pref_Prefs extends Handler_Protected { "SHOW_CONTENT_PREVIEW" => array(__("Show content preview in headlines list"), ""), "SORT_HEADLINES_BY_FEED_DATE" => array(__("Sort headlines by feed date"), __("Use feed-specified date to sort headlines instead of local import date.")), "SSL_CERT_SERIAL" => array(__("Login with an SSL certificate"), __("Click to register your SSL client certificate with tt-rss")), - "STRIP_IMAGES" => array(__("Do not embed images in articles"), ""), + "STRIP_IMAGES" => array(__("Do not embed media in articles"), ""), "STRIP_UNSAFE_TAGS" => array(__("Strip unsafe tags from articles"), __("Strip all but most common HTML tags when reading articles.")), "USER_STYLESHEET" => array(__("Customize stylesheet"), __("Customize CSS stylesheet to your liking")), "USER_TIMEZONE" => array(__("Time zone"), ""), @@ -60,9 +60,9 @@ class Pref_Prefs extends Handler_Protected { function changepassword() { - $old_pw = $_POST["old_password"]; - $new_pw = $_POST["new_password"]; - $con_pw = $_POST["confirm_password"]; + $old_pw = clean($_POST["old_password"]); + $new_pw = clean($_POST["new_password"]); + $con_pw = clean($_POST["confirm_password"]); if ($old_pw == "") { print "ERROR: ".format_error("Old password cannot be blank."); @@ -89,7 +89,7 @@ class Pref_Prefs extends Handler_Protected { } function saveconfig() { - $boolean_prefs = explode(",", $_POST["boolean_prefs"]); + $boolean_prefs = explode(",", clean($_POST["boolean_prefs"])); foreach ($boolean_prefs as $pref) { if (!isset($_POST[$pref])) $_POST[$pref] = 'false'; @@ -99,7 +99,6 @@ class Pref_Prefs extends Handler_Protected { foreach (array_keys($_POST) as $pref_name) { - $pref_name = $pref_name; $value = $_POST[$pref_name]; if ($pref_name == 'DIGEST_PREFERRED_TIME') { @@ -130,8 +129,8 @@ class Pref_Prefs extends Handler_Protected { function changeemail() { - $email = $_POST["email"]; - $full_name = $_POST["full_name"]; + $email = clean($_POST["email"]); + $full_name = clean($_POST["full_name"]); $active_uid = $_SESSION["uid"]; $sth = $this->pdo->prepare("UPDATE ttrss_users SET email = ?, @@ -147,8 +146,8 @@ class Pref_Prefs extends Handler_Protected { $_SESSION["prefs_op_result"] = "reset-to-defaults"; - $sth = $this->pdo->query("DELETE FROM ttrss_user_prefs - WHERE (profile = :profile OR (:profile IS NULL AND profile IS NULL)) + $sth = $this->pdo->prepare("DELETE FROM ttrss_user_prefs + WHERE (profile = :profile OR (:profile IS NULL AND profile IS NULL)) AND owner_uid = :uid"); $sth->execute([":profile" => $_SESSION['profile'], ":uid" => $_SESSION['uid']]); @@ -163,7 +162,7 @@ class Pref_Prefs extends Handler_Protected { $prefs_blacklist = array("ALLOW_DUPLICATE_POSTS", "STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES", "SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT", - "FEEDS_SORT_BY_UNREAD"); + "FEEDS_SORT_BY_UNREAD", "CDM_EXPANDED"); /* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */ @@ -173,6 +172,7 @@ class Pref_Prefs extends Handler_Protected { "DEFAULT_UPDATE_INTERVAL", "USER_TIMEZONE", "SORT_HEADLINES_BY_FEED_DATE", "SSL_CERT_SERIAL", "DIGEST_PREFERRED_TIME"); + $digest_options = array("DIGEST_ENABLE", "DIGEST_CATCHUP", "DIGEST_PREFERRED_TIME"); $_SESSION["prefs_op_result"] = ""; @@ -228,7 +228,7 @@ class Pref_Prefs extends Handler_Protected { print_hidden("op", "pref-prefs"); print_hidden("method", "changeemail"); - print "