In the case of a private paste, don't shorten the URL to prevent scraping

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2016-02-21 00:14:51 +00:00
parent dc582313c9
commit 0c956fabaa

View file

@ -16,6 +16,9 @@ class URLShortener
{
public function shorten($long_url)
{
if(preg_match('/^http(s)?:\/\/(.+).fedoraproject.org\/(\d+)\/(\d+)\/$/', $long_url)) {
return $long_url;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://ur1.ca/");
curl_setopt($ch, CURLOPT_POST, 1);