]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
move language detection to a plugin, remove config.php constant
[tt-rss.git] / include / functions.php
index 1dbf004daf3c699e4bc03b65b98b0b2ec00c6a2f..5c10ac6ac790198e21ed55bee25407172767b6f3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
        define('EXPECTED_CONFIG_VERSION', 26);
-       define('SCHEMA_VERSION', 126);
+       define('SCHEMA_VERSION', 127);
 
        define('LABEL_BASE_INDEX', -1024);
        define('PLUGIN_FEED_BASE_INDEX', -128);
@@ -14,6 +14,8 @@
        $fetch_curl_used = false;
        $suppress_debugging = false;
 
+       libxml_disable_entity_loader(true);
+
        mb_internal_encoding("UTF-8");
        date_default_timezone_set('UTC');
        if (defined('E_DEPRECATED')) {
@@ -65,6 +67,7 @@
                $tr = array(
                                        "auto"  => "Detect automatically",
                                        "ar_SA" => "العربيّة (Arabic)",
+                                       "bg_BG" => "Bulgarian",
                                        "da_DA" => "Dansk",
                                        "ca_CA" => "Català",
                                        "cs_CZ" => "Česky",
@@ -96,8 +99,6 @@
        require_once "lib/accept-to-gettext.php";
        require_once "lib/gettext/gettext.inc";
 
-       require_once "lib/languagedetect/LanguageDetect.php";
-
        function startup_gettext() {
 
                # Get locale from Accept-Language header
                $url = ltrim($url, ' ');
                $url = str_replace(' ', '%20', $url);
 
+               if (strpos($url, "//") === 0)
+                       $url = 'http:' . $url;
+
                if (!defined('NO_CURL') && function_exists('curl_init')) {
 
                        $fetch_curl_used = true;
 
        function initialize_user($uid) {
 
-               db_query("insert into ttrss_feeds (owner_uid,title,feed_url)
-                       values ('$uid', 'Tiny Tiny RSS: New Releases',
-                       'http://tt-rss.org/releases.rss')");
-
                db_query("insert into ttrss_feeds (owner_uid,title,feed_url)
                        values ('$uid', 'Tiny Tiny RSS: Forum',
                                'http://tt-rss.org/forum/rss.php')");
                        $feed_id = db_fetch_result($result, 0, "id");
 
                        if ($feed_id) {
-                               update_rss_feed($feed_id, true);
+                               set_basic_feed_info($feed_id);
                        }
 
                        return array("code" => 1);