Project

General

Profile

Actions

Bug #22243

closed

Several GIFBUILDER features broken for IM6 and GM

Added by Jörg Wagner about 14 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-03-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When IM6 or GM are used, several GIFBUILDER features that internally use mask images (e.g. SHADOW and NICETEXT) are broken.
The reason is a flawed processing of quoted parts in IM commands that probably has many more side effects.

Function unQuoteFilenames() in t3lib/class.t3lib_div explodes the IM/GM parameter string by blanks and tries to do a kind of CVS explode that honors quotes within the parameter string and does not explode quoted params if they contain blanks.

This is done by searching for quotes at the beginning and end of each item in the parameter string. If an item starts with a quote, all subsequent items are joint with it until an item is found that ends with a quote.

Unfortunatelly the function does not check, whether an item starting with a quote already contains a closing quote at its end. This leads to the effect that at least 2 quoted items are joint, even if they contain opening AND closing quotes.

As 4.3 quotes the IM arguments very consequently (in contrast to 4.2), this leads to many subsequent errors in 4.3 that did not become visible in 4.2 (although the basic flaw already exists in 4.2). Among those subsequent errors are the GIFBUILDER failures listed above.

Here is an example of a typical content of the array returned from function t3lib_div::unQuoteFilenames() WITHOUT and WITH the patch. (This example is from a GIFBUILDER SHADOW calculation.)

WITHOUT PATCH
Array
(
[0] => +profile
[1] => '*'
[2] => -compose
[3] => over
[4] => +matte
[5] => "typo3temp/temp/b49e8fb309f9a66316a4d252edc964f1_menuNT.gif" "typo3temp/temp/b49e8fb309f9a66316a4d252edc964f1_colorNT.gif"
[6] => "typo3temp/temp/941a8f43294c13c906c4039dc3a8c9db.gif" "typo3temp/temp/b49e8fb309f9a66316a4d252edc964f1_menuNT.gif"
)

WITH PATCH
Array
(
[0] => +profile
[1] => '*'
[2] => -compose
[3] => over
[4] => +matte
[5] => "typo3temp/temp/b49e8fb309f9a66316a4d252edc964f1_menuNT.gif"
[6] => "typo3temp/temp/b49e8fb309f9a66316a4d252edc964f1_colorNT.gif"
[7] => "typo3temp/temp/941a8f43294c13c906c4039dc3a8c9db.gif"
[8] => "typo3temp/temp/b49e8fb309f9a66316a4d252edc964f1_menuNT.gif"
)

Without the patch any subsequent processing will risk to fail when working on the result and expecting its parameters at certain positions.

SOLUTION:
The solution is simple. When testing substrings for leading quotes, the function may only go into "start quote found" mode if the substring does not also contain a trailing quote. This is done by a simple extension of the regular expression used to detect leading quotes.
(issue imported from #M13750)


Files

patch 4.3.2 20100305.diff (628 Bytes) patch 4.3.2 20100305.diff Administrator Admin, 2010-03-05 12:37
patch 4.3.2 20100311.diff (1011 Bytes) patch 4.3.2 20100311.diff Administrator Admin, 2010-03-11 13:43
patch 4.2.12 20100311.diff (979 Bytes) patch 4.2.12 20100311.diff Administrator Admin, 2010-03-11 13:44
testcase_4-4-alpha2_0013750.patch (6.81 KB) testcase_4-4-alpha2_0013750.patch Administrator Admin, 2010-03-18 11:23
4-4-alpha2_0013750.patch (1.83 KB) 4-4-alpha2_0013750.patch Administrator Admin, 2010-03-18 11:23
13750_patch_4.2.12.diff (1021 Bytes) 13750_patch_4.2.12.diff Administrator Admin, 2010-05-28 13:19
13750_patch_4.3.3.diff (1.02 KB) 13750_patch_4.3.3.diff Administrator Admin, 2010-05-28 13:19
13750_r7477.diff (672 Bytes) 13750_r7477.diff Administrator Admin, 2010-05-28 13:19
13750_trunk.diff (654 Bytes) 13750_trunk.diff Administrator Admin, 2010-05-28 13:19
13750_Problem2_v1_4.4.5.diff (270 Bytes) 13750_Problem2_v1_4.4.5.diff Administrator Admin, 2010-12-21 01:07

Related issues 6 (0 open6 closed)

Related to TYPO3 Core - Bug #22322: combining images with GraphicsMagick not working correctly since 4.2.10Closed2010-03-24

Actions
Related to TYPO3 Core - Bug #17489: Install Tool image tests fail when there are spaces in the path nameClosedErnesto Baschny2007-07-19

Actions
Related to TYPO3 Core - Bug #24377: t3lib_div::unQuoteFilenames fails to detect quotes properlyClosedJigal van Hemert2010-12-21

Actions
Related to TYPO3 Core - Bug #24378: Frame added to IM/GM commands should be inside quotesClosed2010-12-21

Actions
Related to TYPO3 Core - Bug #24379: t3lib_stdGraphic::wrapFileName performs escapeshellarg even in safe_modeClosedJigal van Hemert2010-12-21

Actions
Related to TYPO3 Core - Bug #24931: Quoting of path and filename in ImageMagick/GraphicsMagick not working on Windows + PHP5.2Closed2011-02-02

Actions
Actions

Also available in: Atom PDF