summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-04-23 23:31:32 +0300
committerAndrew Dolgov <[email protected]>2017-04-23 23:31:32 +0300
commitedb56571f281c3377d5cabb2e5e49dcebd0e6036 (patch)
tree9cf7047d79f4b33734cace8232c30b94ccc14f52
parented0f2a6c974987033f0400924a7d328f92fe096d (diff)
parentc7360f4a54e9470fc36105f5a4289769ca402889 (diff)
Merge branch 'imgproxy_ssl_whitelist_tweaks' into 'master'
af_zz_imgproxy optional SSL whitelist tweaks See merge request !51
-rw-r--r--plugins/af_zz_imgproxy/init.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php
index 5fab3b7b8..86f79c694 100644
--- a/plugins/af_zz_imgproxy/init.php
+++ b/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;
+ }
}
}