mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 20:35:55 +00:00
checkbox to sql bool related changes, some more boolean fixes
This commit is contained in:
@@ -696,7 +696,7 @@ class Pref_Filters extends Handler_Protected {
|
|||||||
if ($rule) {
|
if ($rule) {
|
||||||
|
|
||||||
$reg_exp = trim($rule["reg_exp"]);
|
$reg_exp = trim($rule["reg_exp"]);
|
||||||
$inverse = isset($rule["inverse"]) ? "true" : "false";
|
$inverse = isset($rule["inverse"]) ? true : false;
|
||||||
|
|
||||||
$filter_type = (int)trim($rule["filter_type"]);
|
$filter_type = (int)trim($rule["filter_type"]);
|
||||||
$match_on = json_encode($rule["feed_id"]);
|
$match_on = json_encode($rule["feed_id"]);
|
||||||
|
|||||||
@@ -1057,7 +1057,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkbox_to_sql_bool($val) {
|
function checkbox_to_sql_bool($val) {
|
||||||
return ($val == "on") ? "true" : "false";
|
return ($val == "on") ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function uniqid_short() {
|
function uniqid_short() {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Af_Psql_Trgm extends Plugin {
|
|||||||
function save() {
|
function save() {
|
||||||
$similarity = (float) db_escape_string($_POST["similarity"]);
|
$similarity = (float) db_escape_string($_POST["similarity"]);
|
||||||
$min_title_length = (int) db_escape_string($_POST["min_title_length"]);
|
$min_title_length = (int) db_escape_string($_POST["min_title_length"]);
|
||||||
$enable_globally = checkbox_to_sql_bool($_POST["enable_globally"]) == "true";
|
$enable_globally = checkbox_to_sql_bool($_POST["enable_globally"]);
|
||||||
|
|
||||||
if ($similarity < 0) $similarity = 0;
|
if ($similarity < 0) $similarity = 0;
|
||||||
if ($similarity > 1) $similarity = 1;
|
if ($similarity > 1) $similarity = 1;
|
||||||
@@ -226,7 +226,7 @@ class Af_Psql_Trgm extends Plugin {
|
|||||||
$enabled_feeds = $this->host->get($this, "enabled_feeds");
|
$enabled_feeds = $this->host->get($this, "enabled_feeds");
|
||||||
if (!is_array($enabled_feeds)) $enabled_feeds = array();
|
if (!is_array($enabled_feeds)) $enabled_feeds = array();
|
||||||
|
|
||||||
$enable = checkbox_to_sql_bool($_POST["trgm_similarity_enabled"]) == 'true';
|
$enable = checkbox_to_sql_bool($_POST["trgm_similarity_enabled"]);
|
||||||
$key = array_search($feed_id, $enabled_feeds);
|
$key = array_search($feed_id, $enabled_feeds);
|
||||||
|
|
||||||
if ($enable) {
|
if ($enable) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Af_Readability extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
$enable_share_anything = checkbox_to_sql_bool($_POST["enable_share_anything"]) == "true";
|
$enable_share_anything = checkbox_to_sql_bool($_POST["enable_share_anything"]);
|
||||||
|
|
||||||
$this->host->set($this, "enable_share_anything", $enable_share_anything);
|
$this->host->set($this, "enable_share_anything", $enable_share_anything);
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ class Af_Readability extends Plugin {
|
|||||||
$enabled_feeds = $this->host->get($this, "enabled_feeds");
|
$enabled_feeds = $this->host->get($this, "enabled_feeds");
|
||||||
if (!is_array($enabled_feeds)) $enabled_feeds = array();
|
if (!is_array($enabled_feeds)) $enabled_feeds = array();
|
||||||
|
|
||||||
$enable = checkbox_to_sql_bool($_POST["af_readability_enabled"]) == 'true';
|
$enable = checkbox_to_sql_bool($_POST["af_readability_enabled"]);
|
||||||
$key = array_search($feed_id, $enabled_feeds);
|
$key = array_search($feed_id, $enabled_feeds);
|
||||||
|
|
||||||
if ($enable) {
|
if ($enable) {
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ class Af_RedditImgur extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
$enable_readability = checkbox_to_sql_bool($_POST["enable_readability"]) == "true";
|
$enable_readability = checkbox_to_sql_bool($_POST["enable_readability"]);
|
||||||
$enable_content_dupcheck = checkbox_to_sql_bool($_POST["enable_content_dupcheck"]) == "true";
|
$enable_content_dupcheck = checkbox_to_sql_bool($_POST["enable_content_dupcheck"]);
|
||||||
|
|
||||||
$this->host->set($this, "enable_readability", $enable_readability, false);
|
$this->host->set($this, "enable_readability", $enable_readability, false);
|
||||||
$this->host->set($this, "enable_content_dupcheck", $enable_content_dupcheck);
|
$this->host->set($this, "enable_content_dupcheck", $enable_content_dupcheck);
|
||||||
|
|||||||
@@ -241,8 +241,8 @@ class Af_Zz_ImgProxy extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
$proxy_all = checkbox_to_sql_bool($_POST["proxy_all"]) == "true";
|
$proxy_all = checkbox_to_sql_bool($_POST["proxy_all"]);
|
||||||
$disable_cache = checkbox_to_sql_bool($_POST["disable_cache"]) == "true";
|
$disable_cache = checkbox_to_sql_bool($_POST["disable_cache"]);
|
||||||
|
|
||||||
$this->host->set($this, "proxy_all", $proxy_all, false);
|
$this->host->set($this, "proxy_all", $proxy_all, false);
|
||||||
$this->host->set($this, "disable_cache", $disable_cache);
|
$this->host->set($this, "disable_cache", $disable_cache);
|
||||||
|
|||||||
Reference in New Issue
Block a user