Bug #30416
closed
meaningfulTempFilePrefix is not multi-byte safe
Added by Steffen Gebert about 13 years ago.
Updated about 7 years ago.
Description
With meaningfulTempFilePrefix
, a prefix for file names of generated image files can be set. The unit is currently (obviously) bytes, not characters.
This causes trouble with $TYPO3_CONF_VARS['SYS']['UTF8filesystem']
, when the string is truncated exactly in the middle of a multi-byte char, resulting in the file not being accessible via HTTP.
The file name "abcÄ" with a prefix length of 4 would cut the last byte of the Ä, resulting in "abc?".
Thus, substring generation has to respect the charset set of the file name, which is then UTF-8.
- Subject changed from meaningfulTempFilePrefix cuts in multi-byte character to meaningfulTempFilePrefix is not multi-byte safe
- Status changed from New to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to New
- % Done changed from 100 to 20
- Complexity set to medium
(only pushed to sandbox)
Create a page called abcÄ and use the following code to reproduce:
config.meaningfulTempFilePrefix = 4
page.1 = IMAGE
page.1 {
file = GIFBUILDER
file {
XY = [10.w]+20,[10.h]+20
backColor = #ff0000
10 = TEXT
10 {
text.data = page:title
text.wrap = |(IMG)
fontColor = #000000
fontSize = 20
offset = 0,20
}
}
}
page.2 = COA
page.2 {
1 = IMG_RESOURCE
1 {
file = GIFBUILDER
file {
XY = [10.w]+20,[10.h]+20
backColor = #00ff00
10 = TEXT
10 {
text.data = page:title
text.wrap = |(CSS)
fontSize = 20
offset = 0,20
fontColor = #000000
}
}
stdWrap.innerWrap (
<h1 style="background: url(/|) no-repeat;" id="headline">
)
}
}
- First image (red one) is outputted as
<img>
, which worked in my tests, although the file name contains the one byte.
- Second image (green one) is rendered as CSS background. This does not work.
Patch set 1 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479
Patch set 2 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479
Patch set 3 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479
Patch set 4 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479
Patch set 5 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479
- Status changed from New to Resolved
- % Done changed from 20 to 100
- Category set to Image Cropping
- Target version set to 4.5.7
- Status changed from Resolved to Closed
Also available in: Atom
PDF