From 229a871be7eec8e96c9fa0efab50e40ccc6c4ef0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 16 Oct 2014 09:01:23 +0400 Subject: do not force sslversion in any cases --- include/functions.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index d783bd853..1dbf004da 100644 --- a/include/functions.php +++ b/include/functions.php @@ -403,10 +403,6 @@ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_query); } - if ((OPENSSL_VERSION_NUMBER >= 0x0090808f) && (OPENSSL_VERSION_NUMBER < 0x10000000)) { - curl_setopt($ch, CURLOPT_SSLVERSION, 3); - } - if ($login && $pass) curl_setopt($ch, CURLOPT_USERPWD, "$login:$pass"); -- cgit v1.2.3-54-g00ecf From 9fd581336e3044425c3d2d915ee81c8c5741d226 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 3 Dec 2014 22:43:25 +0300 Subject: fetch_file_contents: support retarded schema-less urls af_comics_dilbert: fix for new dilbert.com shenanigans --- include/functions.php | 3 +++ plugins/af_comics/filters/af_comics_dilbert.php | 22 ++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 1dbf004da..769c27af9 100644 --- a/include/functions.php +++ b/include/functions.php @@ -357,6 +357,9 @@ $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; diff --git a/plugins/af_comics/filters/af_comics_dilbert.php b/plugins/af_comics/filters/af_comics_dilbert.php index f0e31cf88..67d9788ab 100644 --- a/plugins/af_comics/filters/af_comics_dilbert.php +++ b/plugins/af_comics/filters/af_comics_dilbert.php @@ -6,23 +6,33 @@ class Af_Comics_Dilbert extends Af_ComicFilter { } function process(&$article) { - $owner_uid = $article["owner_uid"]; - if (strpos($article["guid"], "dilbert.com") !== FALSE) { + $res = fetch_file_contents($article["link"], false, false, false, + false, false, 0, + "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)"); + + global $fetch_last_error_content; + + if (!$res && $fetch_last_error_content) + $res = $fetch_last_error_content; + $doc = new DOMDocument(); - @$doc->loadHTML(fetch_file_contents($article["link"])); + @$doc->loadHTML($res); $basenode = false; if ($doc) { $xpath = new DOMXPath($doc); - $entries = $xpath->query('(//img[@src])'); // we might also check for img[@class='strip'] I guess... + + $basenode = $xpath->query('//div[@class="STR_Image"]')->item(0); + + /* $entries = $xpath->query('(//img[@src])'); // we might also check for img[@class='strip'] I guess... $matches = array(); foreach ($entries as $entry) { - if (preg_match("/dyn\/str_strip\/.*zoom\.gif$/", $entry->getAttribute("src"), $matches)) { + if (preg_match("/dyn\/str_strip\/.*strip\.gif$/", $entry->getAttribute("src"), $matches)) { $entry->setAttribute("src", rewrite_relative_url("http://dilbert.com/", @@ -31,7 +41,7 @@ class Af_Comics_Dilbert extends Af_ComicFilter { $basenode = $entry; break; } - } + } */ if ($basenode) { $article["content"] = $doc->saveXML($basenode); -- cgit v1.2.3-54-g00ecf From 584411fee6ab22037db0201dfff9133b74c0ebac Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 8 Dec 2014 14:49:54 +0300 Subject: disable libxml entity loader to prevent attacks via xml external entities (fixes #833) --- include/functions.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 769c27af9..2f3daea10 100644 --- a/include/functions.php +++ b/include/functions.php @@ -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')) { -- cgit v1.2.3-54-g00ecf From bd40827b737464ea2de8857fded057122543990a Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 18 Dec 2014 02:18:17 -0500 Subject: Drop duplicate database indexes These duplicate indexes were found by the pt-duplicate-key-checker tool in percona-toolkit. Duplicate indexes waste space and slow down the query planner. Closes #835. Signed-off-by: Anders Kaseorg --- include/functions.php | 2 +- schema/ttrss_schema_mysql.sql | 16 ++-------------- schema/ttrss_schema_pgsql.sql | 7 ++----- schema/versions/mysql/127.sql | 18 ++++++++++++++++++ schema/versions/pgsql/127.sql | 8 ++++++++ 5 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 schema/versions/mysql/127.sql create mode 100644 schema/versions/pgsql/127.sql (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 2f3daea10..9b93aed80 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@ Date: Sun, 1 Feb 2015 22:11:06 +0300 Subject: do not subscribe new users to now obsolete releases feed --- include/functions.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 9b93aed80..35124ba08 100644 --- a/include/functions.php +++ b/include/functions.php @@ -805,10 +805,6 @@ 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')"); -- cgit v1.2.3-54-g00ecf