Skip to content

Commit

Permalink
1.0 release, fix for tildes
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Taggart committed Nov 14, 2014
1 parent ec1e07d commit fce9585
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions mthumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit fce9585

Please sign in to comment.