Compare end of domains when checking known SSL whitelist.

For example: "imgur.com.mysite.com" should not match the "imgur.com" whitelist entry.
This commit is contained in:
wn_ 2017-04-23 13:55:14 -05:00
parent ed0f2a6c97
commit f2fbb4ee7e
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ class Af_Zz_ImgProxy extends Plugin {
$parts = parse_url($url); $parts = parse_url($url);
foreach (explode(" " , $this->ssl_known_whitelist) as $host) { 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'; $parts['scheme'] = 'https';
return build_url($parts); return build_url($parts);