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:
parent
dc582313c9
commit
0c956fabaa
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,9 @@ class URLShortener
|
||||||
{
|
{
|
||||||
public function shorten($long_url)
|
public function shorten($long_url)
|
||||||
{
|
{
|
||||||
|
if(preg_match('/^http(s)?:\/\/(.+).fedoraproject.org\/(\d+)\/(\d+)\/$/', $long_url)) {
|
||||||
|
return $long_url;
|
||||||
|
}
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL,"http://ur1.ca/");
|
curl_setopt($ch, CURLOPT_URL,"http://ur1.ca/");
|
||||||
curl_setopt($ch, CURLOPT_POST, 1);
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue