Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: phoxim on November 22, 2020, 09:47:43 AM

Title: fatal errors after updating to 2.0.17
Post by: phoxim on November 22, 2020, 09:47:43 AM
hi there,
after updating the forum to 2.0.17 two different fatal errors occur when trying to read some posts.

forum url: www.sfmforum.de

fatal errors:
Fatal error: Call to undefined function get_proxied_url() in /www/htdocs/v078724/forum/Sources/Load.php on line 1056
http://www.phoxim.de/forum/index.php?topic=33297.0
and
Fatal error: Call to undefined function get_proxied_url() in /www/htdocs/v078724/forum/Sources/Subs.php on line 1289
http://www.phoxim.de/forum/index.php?topic=41863.0

any suggestions please
wolfgang


Title: Re: fatal errors after updating to 2.0.17
Post by: vbgamer45 on November 22, 2020, 10:32:00 AM
Looks like you are missing this function from the end of your Sources/Subs.php file

/**
* Gets the appropriate URL to use for images (or whatever) when using SSL
*
* The returned URL may or may not be a proxied URL, depending on the situation.
* Mods can implement alternative proxies using the 'integrate_proxy' hook.
*
* @param string $url The original URL of the requested resource
* @return string The URL to use
*/
function get_proxied_url($url)
{
global $boardurl, $image_proxy_enabled, $image_proxy_secret, $user_info;

// Only use the proxy if enabled, and never for robots
if (empty($image_proxy_enabled) || !empty($user_info['possibly_robot']))
return $url;

$parsedurl = parse_url($url);

// Don't bother with HTTPS URLs, schemeless URLs, or obviously invalid URLs
if (empty($parsedurl['scheme']) || empty($parsedurl['host']) || empty($parsedurl['path']) || $parsedurl['scheme'] === 'https')
return $url;

// We don't need to proxy our own resources
if ($parsedurl['host'] === parse_url($boardurl, PHP_URL_HOST))
return strtr($url, array('http://' => 'https://'));

// By default, use SMF's own image proxy script
$proxied_url = strtr($boardurl, array('http://' => 'https://')) . '/proxy.php?request=' . urlencode($url) . '&hash=' . hash_hmac('sha1', $url, $image_proxy_secret);

// Allow mods to easily implement an alternative proxy
call_integration_hook('integrate_proxy', array($url, &$proxied_url));

return $proxied_url;
}
Title: Re: fatal errors after updating to 2.0.17
Post by: phoxim on November 22, 2020, 11:56:04 AM
hey superhero  8)
that worked pretty well ! thank you very much  ;)
wolfgang
Title: Re: fatal errors after updating to 2.0.17
Post by: vbgamer45 on November 22, 2020, 11:56:37 AM
Glad to help