]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
Merge branch 'func-missing-quotes' of JustAMacUser/tt-rss into master
[tt-rss.git] / include / functions.php
index 0fd8ef61ac05a9cfd82e75b4f9f2d2ca61834a0a..107a02843a43443a0c8a10dc1914d44046425b7b 100644 (file)
        // this is used for user http parameters unless HTML code is actually needed
        function clean($param) {
                if (is_array($param)) {
-                       return array_map(strip_tags, $param);
+                       return array_map("strip_tags", $param);
                } else if (is_string($param)) {
                        return strip_tags($param);
                } else {
        }
 
        function bool_to_sql_bool($s) {
-               return (bool)$s; //no-op for PDO
+               return $s ? 1 : 0;
        }
 
        // Session caching removed due to causing wrong redirects to upgrade
                        }
 
                        if ($entry->nodeName == 'img') {
+                               $entry->setAttribute('referrerpolicy', 'no-referrer');
 
                                if ($entry->hasAttribute('src')) {
                                        $is_https_url = parse_url($entry->getAttribute('src'), PHP_URL_SCHEME) === 'https';
                                        if ($rule["cat_id"] > 0) {
                                                $children = Feeds::getChildCategories($rule["cat_id"], $owner_uid);
                                                array_push($children, $rule["cat_id"]);
+                                               $children = array_map("intval", $children);
 
                                                $children = join(",", $children);
 
 
                foreach ($files as $js) {
                        if (!isset($_GET['debug'])) {
-                               $cached_file = CACHE_DIR . "/js/".basename($js).".js";
+                               $cached_file = CACHE_DIR . "/js/".basename($js);
 
-                               if (file_exists($cached_file) && is_readable($cached_file) && filemtime($cached_file) >= filemtime("js/$js.js")) {
+                               if (file_exists($cached_file) && is_readable($cached_file) && filemtime($cached_file) >= filemtime("js/$js")) {
 
                                        list($header, $contents) = explode("\n", file_get_contents($cached_file), 2);
 
                                        }
                                }
 
-                               $minified = JShrink\Minifier::minify(file_get_contents("js/$js.js"));
+                               $minified = JShrink\Minifier::minify(file_get_contents("js/$js"));
                                file_put_contents($cached_file, "tt-rss:" . VERSION . "\n" . $minified);
                                $rv .= $minified;
 
                        } else {
-                               $rv .= file_get_contents("js/$js.js"); // no cache in debug mode
+                               $rv .= file_get_contents("js/$js"); // no cache in debug mode
                        }
                }