]> git.wh0rd.org - tt-rss.git/blobdiff - xml-rpc.php
code cleanup, test for db_escape() crazyness in DB sanity check
[tt-rss.git] / xml-rpc.php
index eaa55e566c3a15ac9d29faefdb2f5228079f2fc7..2a23f57f677bcc175e4bc9cbf47c402c6407ccba 100644 (file)
@@ -19,9 +19,7 @@
                return;
        }
 
-       if (DB_TYPE == "pgsql") {
-               pg_query("set client_encoding = 'utf-8'");
-       }
+       init_connection($link);
 
        function getVirtualFeeds($msg) {
                global $link;
                if (authenticate_user($link, $login, $pass)) {
 
                        $result = db_query($link, "SELECT 
-                               id, feed_url, cat_id, title, SUBSTRING(last_updated,1,19) AS last_updated
+                               id, feed_url, cat_id, title, ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated
                                        FROM ttrss_feeds WHERE owner_uid = " . 
                                $_SESSION["uid"]);
 
 
                        $query = "SELECT title,link,content,feed_id,comments,int_id,
                                marked,unread,
-                               SUBSTRING(updated,1,16) as updated,
+                               ".SUBSTRING_FOR_DATE."(updated,1,16) as updated,
                                author
                                FROM ttrss_entries,ttrss_user_entries
                                WHERE   id = '$article_id' AND ref_id = id AND owner_uid = " . $_SESSION["uid"] ;