]> 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 d61382c0890aa701416ce623aba2441c5e02f180..2a23f57f677bcc175e4bc9cbf47c402c6407ccba 100644 (file)
                return;
        }
 
-       if (DB_TYPE == "pgsql") {
-               pg_query("set client_encoding = 'utf-8'");
-               pg_set_client_encoding("UNICODE");
-       } else {
-               db_query($link, "SET NAMES utf8");
-               db_query($link, "SET CHARACTER SET utf8");
-       }
+       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"] ;