Browse Source

Merge branch 'imgproxy_ssl_whitelist_tweaks' into 'master'

af_zz_imgproxy optional SSL whitelist tweaks

See merge request !51

Andrew Dolgov 7 years ago
parent
commit
edb56571f2
1 changed files with 7 additions and 3 deletions
  1. 7 3
      plugins/af_zz_imgproxy/init.php

+ 7 - 3
plugins/af_zz_imgproxy/init.php

@@ -124,10 +124,14 @@ 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);
+						$url = build_url($parts);
+						if ($all_remote && $is_remote) {
+							break;
+						} else {
+							return $url;
+						}
 					}
 				}