]> git.wh0rd.org Git - tt-rss.git/commitdiff
Compare end of domains when checking known SSL whitelist.
authorwn_ <invalid@email.com>
Sun, 23 Apr 2017 18:55:14 +0000 (13:55 -0500)
committerwn_ <invalid@email.com>
Sun, 23 Apr 2017 20:13:07 +0000 (15:13 -0500)
For example: "imgur.com.mysite.com" should not match the "imgur.com" whitelist entry.

plugins/af_zz_imgproxy/init.php

index 5fab3b7b8940df1461584524de1e03359f536eff..8419b8a8747ca8221c92500d698f9db8dcb721f6 100644 (file)
@@ -124,7 +124,7 @@ class Af_Zz_ImgProxy extends Plugin {
                                $parts = parse_url($url);
 
                                foreach (explode(" " , $this->ssl_known_whitelist) as $host) {
-                                       if (strpos($parts['host'], $host) !== FALSE) {
+                                       if (substr(strtolower($parts['host']), -strlen($host)) === strtolower($host)) {
                                                $parts['scheme'] = 'https';
 
                                                return build_url($parts);