"Warning: exec() has been disabled" message

12 years 9 months ago #19881 by beat
I implemented and thought i tested this in CB 1.0.1 before releasing :S

Well, please log bug at forge with reference to this thread and server versions information and i will take a look for next version.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
12 years 9 months ago #19955 by walb
imgToolbox.class.php line 628 holding[code:1]
return in_array( 'exec', explode( ',',ini_get( 'disable_functions' ) ) );[/code:1]change into[code:1] return in_array( 'exec', explode( ', ',ini_get( 'disable_functions' ) ) );
[/code:1]Note the extra space behind the comma. This will cause that the exec function is found and no warning is displayed.
12 years 9 months ago #20104 by beat
walb wrote:

imgToolbox.class.php line 628 holding[code:1]
return in_array( 'exec', explode( ',',ini_get( 'disable_functions' ) ) );[/code:1]change into[code:1] return in_array( 'exec', explode( ', ',ini_get( 'disable_functions' ) ) );
[/code:1]Note the extra space behind the comma. This will cause that the exec function is found and no warning is displayed.


Thanks for noticing, fixed in next release with following code:

[code:1] function cbIsExecDisabled(){
if (is_callable("ini_get"«»)) {
$funcs = explode( ',',ini_get( 'disable_functions' ) );
for ( $i=0, $n=count($funcs); $i<$n; $i++ ) {
$funcs[$i] = trim($funcs[$i]);
}
return in_array( 'exec', $funcs );
} else {
return false;
}
}
[/code:1]

Can you please test final fix and report back if ok at your site ?

Thanks

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
12 years 9 months ago #20212 by walb
beat wrote:


Thanks for noticing, fixed in next release with following code:

[code:1] function cbIsExecDisabled(){
if (is_callable("ini_get")) {
$funcs = explode( ',',ini_get( 'disable_functions' ) );
for ( $i=0, $n=count($funcs); $i<$n; $i++ ) {
$funcs[$i] = trim($funcs[$i]);
}
return in_array( 'exec', $funcs );
} else {
return false;
}
}
[/code:1]

Can you please test final fix and report back if ok at your site ?

Thanks

The code is tested and is of course OK.;)
Thanks,
Walb
Moderators: beatnantkrileon
Time to create page: 0.382 seconds
Facebook Twitter Google LinkedIn