From fce9585997a2a6418abf0761a5607f8480546cd8 Mon Sep 17 00:00:00 2001 From: Damian Taggart Date: Fri, 14 Nov 2014 15:25:59 -0700 Subject: [PATCH] 1.0 release, fix for tildes --- mthumb.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/mthumb.php b/mthumb.php index d95973f..f32a540 100644 --- a/mthumb.php +++ b/mthumb.php @@ -436,24 +436,19 @@ public function __construct() { // start mindshare fix for tilde's, check if tilde is found in src if(strstr($this->param('src'), '~')) { $url_parts = explode('/', $this->param('src')); - foreach($url_parts as $url_part) { //do not include any part with a ~ when building new url if(!strstr($url_part, '~')) { - $new_dev_url = $url_part.'/'; + $new_dev_url .= $url_part.'/'; } } - - // remove trailing slash - if(isset($new_dev_url)) { - $new_dev_url = substr($new_dev_url, 0, -1); - $this->src = $new_dev_url; - } + //remove trailing slash + $new_dev_url = substr($new_dev_url, 0, -1); + $this->src = $new_dev_url; } else { $this->src = $this->param('src'); } - - // start mindshare fix for tilde's + // end mindshare fix for tilde's $this->url = parse_url($this->src); $this->src = preg_replace('/https?:\/\/(?:www\.)?'.$this->myHost.'/i', '', $this->src);