Wedge
Public area => Bug reports => The Pub => Archived fixes => Topic started 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:
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) ;)
-
Huh, interesting. Thanks for that :)
Personally I'd wrap it in is_callable, rather than function_exists but the principle's much the same.
-
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.
-
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.
-
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...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...
-
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!).