force-cast some variables used in queries to integer
do not display SQL query in headlines debug mode
This commit is contained in:
parent
d0cce0c7a4
commit
bed2d6e054
|
@ -1271,6 +1271,7 @@ class Feeds extends Handler_Protected {
|
||||||
if ($feed > 0) {
|
if ($feed > 0) {
|
||||||
$children = Feeds::getChildCategories($feed, $owner_uid);
|
$children = Feeds::getChildCategories($feed, $owner_uid);
|
||||||
array_push($children, $feed);
|
array_push($children, $feed);
|
||||||
|
$children = array_map("intval", $children);
|
||||||
|
|
||||||
$children = join(",", $children);
|
$children = join(",", $children);
|
||||||
|
|
||||||
|
@ -1437,7 +1438,7 @@ class Feeds extends Handler_Protected {
|
||||||
} else if ($n_feed >= 0) {
|
} else if ($n_feed >= 0) {
|
||||||
|
|
||||||
if ($n_feed != 0) {
|
if ($n_feed != 0) {
|
||||||
$match_part = "feed_id = '$n_feed'";
|
$match_part = "feed_id = " . (int)$n_feed;
|
||||||
} else {
|
} else {
|
||||||
$match_part = "feed_id IS NULL";
|
$match_part = "feed_id IS NULL";
|
||||||
}
|
}
|
||||||
|
@ -1672,7 +1673,7 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$cat_feeds = array();
|
$cat_feeds = array();
|
||||||
while ($line = $sth->fetch()) {
|
while ($line = $sth->fetch()) {
|
||||||
array_push($cat_feeds, "feed_id = " . $line["id"]);
|
array_push($cat_feeds, "feed_id = " . (int)$line["id"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($cat_feeds) == 0) return 0;
|
if (count($cat_feeds) == 0) return 0;
|
||||||
|
@ -1887,8 +1888,9 @@ class Feeds extends Handler_Protected {
|
||||||
if ($include_children) {
|
if ($include_children) {
|
||||||
# sub-cats
|
# sub-cats
|
||||||
$subcats = Feeds::getChildCategories($feed, $owner_uid);
|
$subcats = Feeds::getChildCategories($feed, $owner_uid);
|
||||||
|
|
||||||
array_push($subcats, $feed);
|
array_push($subcats, $feed);
|
||||||
|
$subcats = array_map("intval", $subcats);
|
||||||
|
|
||||||
$query_strategy_part = "cat_id IN (".
|
$query_strategy_part = "cat_id IN (".
|
||||||
implode(",", $subcats).")";
|
implode(",", $subcats).")";
|
||||||
|
|
||||||
|
@ -2096,9 +2098,9 @@ class Feeds extends Handler_Protected {
|
||||||
$sanity_interval_qpart
|
$sanity_interval_qpart
|
||||||
$first_id_query_strategy_part ORDER BY $order_by LIMIT 1";
|
$first_id_query_strategy_part ORDER BY $order_by LIMIT 1";
|
||||||
|
|
||||||
if ($_REQUEST["debug"]) {
|
/*if ($_REQUEST["debug"]) {
|
||||||
print $query;
|
print $query;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
$res = $pdo->query($query);
|
$res = $pdo->query($query);
|
||||||
|
|
||||||
|
@ -2144,7 +2146,7 @@ class Feeds extends Handler_Protected {
|
||||||
$query_strategy_part ORDER BY $order_by
|
$query_strategy_part ORDER BY $order_by
|
||||||
$limit_query_part $offset_query_part";
|
$limit_query_part $offset_query_part";
|
||||||
|
|
||||||
if ($_REQUEST["debug"]) print $query;
|
//if ($_REQUEST["debug"]) print $query;
|
||||||
|
|
||||||
$res = $pdo->query($query);
|
$res = $pdo->query($query);
|
||||||
|
|
||||||
|
|
|
@ -2278,6 +2278,7 @@
|
||||||
if ($rule["cat_id"] > 0) {
|
if ($rule["cat_id"] > 0) {
|
||||||
$children = Feeds::getChildCategories($rule["cat_id"], $owner_uid);
|
$children = Feeds::getChildCategories($rule["cat_id"], $owner_uid);
|
||||||
array_push($children, $rule["cat_id"]);
|
array_push($children, $rule["cat_id"]);
|
||||||
|
$children = array_map("intval", $children);
|
||||||
|
|
||||||
$children = join(",", $children);
|
$children = join(",", $children);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue