]> git.wh0rd.org - tt-rss.git/commitdiff
api, setArticleLabel: allow JSON booleans
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 15 Oct 2017 13:47:44 +0000 (16:47 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 15 Oct 2017 13:47:44 +0000 (16:47 +0300)
classes/api.php

index 97050e1054d7c43893d1e41c2acb74d285d2069f..bb4d332471f2ddd86d81fe3b5806b9445f1941c1 100644 (file)
@@ -466,7 +466,7 @@ class API extends Handler {
 
                $article_ids = array_filter(explode(",", $this->dbh->escape_string($_REQUEST["article_ids"])), is_numeric);
                $label_id = (int) $this->dbh->escape_string($_REQUEST['label_id']);
-               $assign = (bool) ($this->dbh->escape_string($_REQUEST['assign']) == "true");
+               $assign = sql_bool_to_bool($_REQUEST['assign']);
 
                $label = $this->dbh->escape_string(Labels::find_caption(
                        Labels::feed_to_label_id($label_id), $_SESSION["uid"]));