]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
Merge branch 'reg_exp_length' of lllusion3418/tt-rss into master
[tt-rss.git] / include / functions.php
index 8e9949f75896215c5edc23e13ef817e573b733c9..b5e2eb77665a41d4e23cb5e45c40630973eb0972 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
        define('EXPECTED_CONFIG_VERSION', 26);
-       define('SCHEMA_VERSION', 133);
+       define('SCHEMA_VERSION', 134);
 
        define('LABEL_BASE_INDEX', -1024);
        define('PLUGIN_FEED_BASE_INDEX', -128);
 
                         $context_options = array(
                                  'http' => array(
+                                               'header' => array(
+                                                       'Connection: close'
+                                               ),
                                                'method' => 'GET',
                                                'ignore_errors' => true,
                                                'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT,
                                  );
 
                        if (!$post_query && $last_modified) {
-                               $context_options['http']['header'] = "If-Modified-Since: $last_modified\r\n";
+                               array_push($context_options['http']['header'], "If-Modified-Since: $last_modified");
                        }
 
                        if (defined('_HTTP_PROXY')) {
                        if ($entry->nodeName == 'img') {
                                $entry->setAttribute('referrerpolicy', 'no-referrer');
 
+                               $entry->removeAttribute('width');
+                               $entry->removeAttribute('height');
+
                                if ($entry->hasAttribute('src')) {
                                        $is_https_url = parse_url($entry->getAttribute('src'), PHP_URL_SCHEME) === 'https';
 
                        }
                }
 
-               $allowed_elements = array('a', 'address', 'acronym', 'audio', 'article', 'aside',
+               $allowed_elements = array('a', 'abbr', 'address', 'acronym', 'audio', 'article', 'aside',
                        'b', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br',
                        'caption', 'cite', 'center', 'code', 'col', 'colgroup',
                        'data', 'dd', 'del', 'details', 'description', 'dfn', 'div', 'dl', 'font',
        }
 
        function tag_is_valid($tag) {
-               if ($tag == '') return false;
-               if (is_numeric($tag)) return false;
-               if (mb_strlen($tag) > 250) return false;
-
-               if (!$tag) return false;
+               if (!$tag || is_numeric($tag) || mb_strlen($tag) > 250)
+                       return false;
 
                return true;
        }