]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
unify houskeeping stuff, increase spawn interval
[tt-rss.git] / include / functions.php
index e861193c20aeacf3e5e187f429615d0813249182..a41d3a950c6ba393fd827b0389ba778e08271169 100644 (file)
                                $ch = curl_init($url);
                        }
 
-                       if ($timestamp) {
+                       if ($timestamp && !$post_query) {
                                curl_setopt($ch, CURLOPT_HTTPHEADER,
                                        array("If-Modified-Since: ".gmdate('D, d M Y H:i:s \G\M\T', $timestamp)));
                        }
                        $data = @file_get_contents($url, false, $context);
 
                        $fetch_last_content_type = false;  // reset if no type was sent from server
-                       if (is_array($http_response_header)) {
+                       if (isset($http_response_header) && is_array($http_response_header)) {
                                foreach ($http_response_header as $h) {
                                        if (substr(strtolower($h), 0, 13) == 'content-type:') {
                                                $fetch_last_content_type = substr($h, 14);
        function get_schema_version($nocache = false) {
                global $schema_version;
 
-               if (!$schema_version) {
+               if (!$schema_version && !$nocache) {
                        $result = db_query("SELECT schema_version FROM ttrss_version");
                        $version = db_fetch_result($result, 0, "schema_version");
                        $schema_version = $version;
                        $url = key($feedUrls);
                }
 
-               libxml_use_internal_errors(true);
+               /* libxml_use_internal_errors(true);
                $doc = new DOMDocument();
-               $doc->loadXML(html_entity_decode($contents));
+               $doc->loadXML($contents);
                $error = libxml_get_last_error();
                libxml_clear_errors();
 
                        $error_message = format_libxml_error($error);
 
                        return array("code" => 6, "message" => $error_message);
-               }
+               } */
 
                if ($cat_id == "0" || !$cat_id) {
                        $cat_qpart = "NULL";