diff options
| author | Patrick Uiterwijk <puiterwijk@redhat.com> | 2016-02-21 00:14:51 +0000 |
|---|---|---|
| committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2016-02-21 00:15:10 +0000 |
| commit | 0c956fabaa0cc741755c2de9ee65b0dcc5ef0b01 (patch) | |
| tree | a7b0fd222d66c8df547e28e0fc6bb9bdbba6f805 /roles/paste/files | |
| parent | dc582313c9d232c90a5f5422f9cb277db3b9cff5 (diff) | |
| download | ansible-0c956fabaa0cc741755c2de9ee65b0dcc5ef0b01.tar.gz ansible-0c956fabaa0cc741755c2de9ee65b0dcc5ef0b01.tar.xz ansible-0c956fabaa0cc741755c2de9ee65b0dcc5ef0b01.zip | |
In the case of a private paste, don't shorten the URL to prevent scraping
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'roles/paste/files')
| -rw-r--r-- | roles/paste/files/class_urlshort.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/roles/paste/files/class_urlshort.php b/roles/paste/files/class_urlshort.php index cb1601168..0657725d5 100644 --- a/roles/paste/files/class_urlshort.php +++ b/roles/paste/files/class_urlshort.php @@ -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); |
