Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: Farjo on February 26th, 2013, 04:34 AM

Title: Media / Settings / Configuration gives WSOD
Post by: Farjo on February 26th, 2013, 04:34 AM
Originally found this on SMF but it's there if Wedge is installed on the same host. It's down to the exec() function being disabled on that server, and I imagine that other users will come up against the same problem on shared servers.

On SMF the code is in Aeva-Media.php and in Wedge it appears to be in Class-Media.php. For SMF I think I've fixed it by wrapping:
Code: [Select]
if (function_exists('exec')) {
around blocks of code with the exec function in.

But I'll leave the Wedge code to you, I don't want to classed as hardcore(http://wedge.org/pub/smf/7962/will-wedge-import-data-from-smf/msg286285/#msg286285) ;)
Title: Re: Media / Settings / Configuration gives WSOD
Post by: Arantor on February 26th, 2013, 04:37 AM
Huh, interesting. Thanks for that :)

Personally I'd wrap it in is_callable, rather than function_exists but the principle's much the same.
Title: Re: Media / Settings / Configuration gives WSOD
Post by: Nao on February 27th, 2013, 07:29 PM
Actually, if the function is disabled through php.ini, then is_callable will return true (because "it won't crash your page, so it's callable..."), and it's function_exists that will return false. As surprising as it is... is_callable is really only for non-existent functions, and should be avoided in many cases.

Thanks for the mention, I've fixed it locally, will commit soon.
Title: Re: Media / Settings / Configuration gives WSOD
Post by: Arantor on February 27th, 2013, 07:33 PM
Really? I've always understood it to be the other way around... but checking the manual confirms you're right. Hmm, that might have some other issues elsewhere.
Title: Re: Media / Settings / Configuration gives WSOD
Post by: Nao on February 27th, 2013, 07:37 PM
Quote from Arantor on February 27th, 2013, 07:33 PM
Really? I've always understood it to be the other way around...
Me too. I discovered that when I worked on implementing a 'proper' json_encode fallback last week. I actually did the whole php.ini stuff and tested myself, because I just couldn't believe it...
Quote from Arantor on February 27th, 2013, 07:33 PM
but checking the manual confirms you're right. Hmm, that might have some other issues elsewhere.
Yup, because we were so convinced it was the other way around, we pushed for is_callable to be used pretty much everywhere...
Title: Re: Media / Settings / Configuration gives WSOD
Post by: Farjo on February 28th, 2013, 01:17 AM
If you boys need any more help with your programming just ask :lol: :rotfl:

Thanks for fixing :thanks:

:edit: ps is there any chance of getting a new copy of Class-Media.php? I would like to check the changes I am going to make to my SMF installation (I am far from a programmer!).