This topic was marked solved by live627, on March 23rd, 2013, 11:47 PM
Media / Settings / Configuration gives WSOD

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Media / Settings / Configuration gives WSOD
« 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 ;)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Media / Settings / Configuration gives WSOD
« Reply #1, 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.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Media / Settings / Configuration gives WSOD
« Reply #2, 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.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Media / Settings / Configuration gives WSOD
« Reply #3, 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.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Media / Settings / Configuration gives WSOD
« Reply #4, 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...

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Re: Media / Settings / Configuration gives WSOD
« Reply #5, on February 28th, 2013, 01:17 AM »Last edited on February 28th, 2013, 03:49 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!).