]> git.wh0rd.org - tt-rss.git/commitdiff
api: always chdir() to base directory (refs #375)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 7 Nov 2011 06:21:18 +0000 (10:21 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 7 Nov 2011 06:21:18 +0000 (10:21 +0400)
api/index.php

index f6e1cb79f5abdfc7a258993128173e608d08f66e..4a5c1bb31422e9a1f1bc9ee6ca0f9a6f01d4c3f9 100644 (file)
@@ -10,6 +10,8 @@
        define('API_STATUS_OK', 0);
        define('API_STATUS_ERR', 1);
 
+       chdir("..");
+
        if (defined('ENABLE_GZIP_OUTPUT') && ENABLE_GZIP_OUTPUT) {
                ob_start("ob_gzhandler");
        }
                        $limit = (int) db_escape_string($_REQUEST["limit"]);
                        $offset = (int) db_escape_string($_REQUEST["offset"]);
 
-                       chdir(".."); // so feed_has_icon() would work properly for relative ICONS_DIR
-
                        $feeds = api_get_feeds($link, $cat_id, $unread_only, $limit, $offset);
 
                        print api_wrap_reply(API_STATUS_OK, $seq, $feeds);