Review main Abandoned

1006[BUGFIX] No image generation with PHP-SAFE_MODE (GM/IM)

Jigal van Hemert CR 0 V 0 Easy +39 −2 updated 06/03/13, 20:49

Commit message

With PHP in SAFE_MODE all imagemagick/graphicsmagick calls will fail. To
support paths with whitespace characters quotes are added (using
escapeshellarg()). With safe_mode enabled PHP executes escapeshellcmd()
on the entire command. Now the quotes will be escaped and the command
will fail.
This patch changes that escapeshellarg is only if it is useful (i.e. if
there are whitespace characters or if characters were escaped).

Review

  • Code review CR 0
  • Verified V 0

Files 3

Review log 7

  1. Dmitry Dulepov commented on patch set 1 04/03/11, 08:57

    It would be cleaner to use \s instead of [[:space:]] with preg_* functions. This is near lines 95 and 114 at class.t3lib_utility_command.php, line 410 in thumb.php, line 2676 in class.t3lib_stdgraphic.php.
  2. Helmut Hummel commented on patch set 1 04/03/11, 08:57

    I would prefer that you didn't submit this Patch in general lloks good, but the bug number in the commit message is wrong
    This is a wrong bug number. Could you please correct it?
  3. Steffen Ritter commented on patch set 1 04/03/11, 08:57

    Looks good to me, approved looks - after you explained the stuff with setting the locales :)
  4. Chris topher commented on patch set 1 04/03/11, 08:57

    Looks good to me, but someone else must approve This is a test, ignore it. I did _not_ review the code and will take this vote away again in a minute.
  5. Jigal van Hemert commented on patch set 1 04/03/11, 08:57

    The character class [:space:] includes the VT character, which is missing from \s (for Perl compatibility). See http://www.php.net/manual/en/regexp.reference.character-classes.php
  6. Marcus Krause commented on patch set 1 04/03/11, 08:57

    I would prefer that you didn't submit this Would you please fix the code comments like outlined in the inline comments?

    class.t3lib_stdgraphic.php:2674

    the comment does not match the actual code (logical OR vs logical AND)

    thumbs.php:408

    the comment does not match the actual code (logical OR vs logical AND)

    class.t3lib_utility_command.php:93

    the comment does not match the actual code (logical OR vs logical AND)

    class.t3lib_utility_command.php:112

    the comment does not match the actual code (logical OR vs logical AND)
  7. Jigal van Hemert commented on patch set 1 04/03/11, 08:57

    Abandoned safe_mode support is dropped in 4.6; no need to have this change in master anymore.