]> git.wh0rd.org - tt-rss.git/blobdiff - classes/article.php
finish xhrPost migration of js/
[tt-rss.git] / classes / article.php
index c5e73ea0261edcbab4c57fa40a6e7697953a5f19..e769a3e9672edde43e38203b949ac9c794b292de 100755 (executable)
@@ -372,8 +372,7 @@ class Article extends Handler_Protected {
                $ids = explode(",", clean($_REQUEST["ids"]));
                $label_id = clean($_REQUEST["lid"]);
 
-               $label = db_escape_string(Labels::find_caption($label_id,
-               $_SESSION["uid"]));
+               $label = Labels::find_caption($label_id, $_SESSION["uid"]);
 
                $reply["info-for-headlines"] = array();
 
@@ -937,24 +936,24 @@ class Article extends Handler_Protected {
                return $rv;
        }
 
-       static function purge_orphans($do_output = false) {
+       static function purge_orphans() {
 
-               // purge orphaned posts in main content table
+        // purge orphaned posts in main content table
 
-               if (DB_TYPE == "mysql")
-                       $limit_qpart = "LIMIT 5000";
-               else
-                       $limit_qpart = "";
+        if (DB_TYPE == "mysql")
+            $limit_qpart = "LIMIT 5000";
+        else
+            $limit_qpart = "";
 
-               $pdo = Db::pdo();
-               $res = $pdo->query("DELETE FROM ttrss_entries WHERE
+        $pdo = Db::pdo();
+        $res = $pdo->query("DELETE FROM ttrss_entries WHERE
                        NOT EXISTS (SELECT ref_id FROM ttrss_user_entries WHERE ref_id = id) $limit_qpart");
 
-               if ($do_output) {
-                       $rows = $res->rowCount();
-                       _debug("Purged $rows orphaned posts.");
-               }
-       }
+        if (Debug::enabled()) {
+            $rows = $res->rowCount();
+            Debug::log("Purged $rows orphaned posts.");
+        }
+    }
 
        static function catchupArticlesById($ids, $cmode, $owner_uid = false) {