Permalink
Browse files

Fix function_usable()

  • Loading branch information...
1 parent 5e87250 commit ae6346228e4993367a72f272345325f1ddf93110 @narfbg narfbg committed Dec 17, 2012
Showing with 11 additions and 6 deletions.
  1. +11 −6 system/core/Common.php
View
17 system/core/Common.php
@@ -681,17 +681,22 @@ function function_usable($function_name)
{
if ( ! isset($_suhosin_func_blacklist))
{
- $_suhosin_func_blacklist = extension_loaded('suhosin')
- ? array()
- : explode(',', trim(@ini_get('suhosin.executor.func.blacklist')));
+ if (extension_loaded('suhosin'))
+ {
+ $_suhosin_func_blacklist = explode(',', trim(@ini_get('suhosin.executor.func.blacklist')));
- if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval'))
+ if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval'))
+ {
+ $_suhosin_func_blacklist[] = 'eval';
+ }
+ }
+ else
{
- $_suhosin_func_blacklist[] = 'eval';
+ $_suhosin_func_blacklist = array();
}
}
- return in_array($function_name, $_suhosin_func_blacklist, TRUE);
+ return ! in_array($function_name, $_suhosin_func_blacklist, TRUE);
}
return FALSE;

1 comment on commit ae63462

@keatliang2005

yes it worked !

Please sign in to comment.