Skip to content

Commit

Permalink
Update Url.php
Browse files Browse the repository at this point in the history
Get the expanded Link
  • Loading branch information
akiyamaSM committed Aug 19, 2018
1 parent f9e3a45 commit d678cd1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Injection/Url.php
Expand Up @@ -27,11 +27,17 @@ public function __construct($url)
$url = str_replace(array(';', '"', '<?'), '', strip_tags($url));
$url = str_replace(array('\077', '\''), array(' ', '/'), $url);

$this->src = $url;
$this->src = expandShortUrl($url);
}

public function __toString()
{
return $this->src;
}

public function expandShortUrl($url)
{
$headers = get_headers($url, 1);
return $headers['location'];
}
}

0 comments on commit d678cd1

Please sign in to comment.