Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Exec() has been disabled  (Read 2824 times)

0 Members and 1 Guest are viewing this topic.

v3

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 12
  • Another addict
    • sonic-world.ru
Exec() has been disabled
« on: September 10, 2006, 05:01:37 pm »

http://forum.coppermine-gallery.net/index.php?topic=24088.msg110691#msg110691
Quote
You may replace exec() with passthru() if it has not been disabled as well.  Otherwise, you must use GD.

Why not to use function_exists() to check if exec is disabled and if both are disabled display a notice and try to use GD?
something like
Code: [Select]
        case "im" :       
        if (!function_exists('exec')) {
        $functions = array ('shell_exec', 'system', 'passthru');
        foreach ($functions as $f) {
        if (!function_exists($f)) {
        eval("
        function exec(\$cmd) {
        $f(\$cmd);
        }");
        $declared = true;
        break;
        }
        }
        if (@!$declared) {
        //display some king of notice or just die
        return resize_image($src_file, $dest_file, $new_size, 'gd2', $thumb_use)
        }
}

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Exec() has been disabled
« Reply #1 on: September 10, 2006, 10:46:40 pm »

Webhosts who allow their users to access ImageMagick but disable exec just have no idea how to run a webserver. Imo we should not care too much about silly webserver setups (just because that's not our business). Instead, I'm planning to add a check into the installer and config that only will allow a user to change the image library if a check has been performed if the settings the user has chosen actually work.
However, others may have a different opinion on this.
Moving this thread from support to feature requests.
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 20 queries.