SMFHacks.com

SMF Gallery Pro => Support => Topic started by: guest3817 on March 16, 2017, 04:41:19 pm

Title: tiny url error
Post by: guest3817 on March 16, 2017, 04:41:19 pm
Hello

I'm getting errors showing the log like the following

http://www.xxxxx.co.uk/forum/index.php?action=gallery;sa=view;id=4617
2: file_get_contents(http://tinyurl.com/api-create.php?url=http://www.xxxxx.co.uk/forum/index.php?action=gallery;sa=view;id=4617): failed to open stream: HTTP request failed! HTTP/1.1 520 Origin Error
File: /home/xxxx/public_html/forum/Sources/Gallery2.php
Line: 12325

I'm using SMF 2.0.13 and Gallery Pro 7.2.2.

I can access the topics showng in the errors from a browser without generating an error.

Any idea what might be causing this?

Thanks
Title: Re: tiny url error
Post by: SMFHacks on March 16, 2017, 04:49:25 pm
Might be hosting/php related issue
change this code in sources/gallery2.php
Code: [Select]
function gallery_getTinyUrl($url)
{


if (function_exists('file_get_contents'))
{
$tinyurl = file_get_contents("http://tinyurl.com/api-create.php?url=".$url);
return $tinyurl;
}
else
return $url;
}
Change to
Code: [Select]
function gallery_getTinyUrl($url)
{


return $url;
}