Bug #27197
closedNo ImageMagick installation available (safe_mode = ON)
0%
Description
Description:
ImageMagick utilities are located in safe_mode_exec_dir but not found. It may be suitable as some ISP still have safemode on their server infrastructure.
The safe_mode_exec_dir is prepended to the command line while executing t3lib_utility_Command::exec. The Imagemagick utilities are not found because it try to execute /usr/local/php/bin/usr/local/php/bin/convert instead of /usr/local/php/bin/convert.
php.ini
safe_mode = ON
safe_mode_exec_dir = "/usr/local/php/bin/"
Additional information:
In safemode you will automatically execute the program convert in the safe_mode_exec_dir no matter what other path you specify. To match this restriction, a safemode check should be added in each related functions.
typo3/sysext/install/mod/class.tx_install.php
function _checkImageMagick_getVersion($file, $path) {
...
+ if($this->config_array['safemode']) $path = '';
$cmd = t3lib_div::imageMagickCommand($file, $parameters, $path);
$retVal = false;
t3lib_utility_Command::exec($cmd, $retVal);
...
}
/t3lib/class.t3lib_div.php
public static function gif_compress($theFile, $type) {
$gfxConf = $GLOBALS['TYPO3_CONF_VARS']['GFX'];
+ if(t3lib_utility_PhpOptions::isSafeModeEnabled()) $gfxConf['im_path_lzw'] = '';
$returnCode = '';
t3lib/utility/class.t3lib_utility_command.php
public static function imageMagickCommand($command, $parameters, $path = '') {
$gfxConf = $GLOBALS['TYPO3_CONF_VARS']['GFX'];
$isExt = (TYPO3_OS == 'WIN' ? '.exe' : '');
$switchCompositeParameters = FALSE;
- if (!$path) {
+ if (!$path && !t3lib_utility_PhpOptions::isSafeModeEnabled()) {
$path = $gfxConf['im_path'];
}