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