Project

General

Profile

Actions

Bug #30416

closed

meaningfulTempFilePrefix is not multi-byte safe

Added by Steffen Gebert over 12 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Image Cropping
Target version:
Start date:
2011-09-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

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.

Actions #1

Updated by Steffen Gebert over 12 years ago

  • Subject changed from meaningfulTempFilePrefix cuts in multi-byte character to meaningfulTempFilePrefix is not multi-byte safe
Actions #2

Updated by Steffen Gebert over 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions #3

Updated by Steffen Gebert over 12 years ago

  • 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.
Actions #4

Updated by Mr. Hudson over 12 years ago

Patch set 1 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479

Actions #5

Updated by Mr. Hudson over 12 years ago

Patch set 2 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479

Actions #6

Updated by Mr. Hudson over 12 years ago

Patch set 3 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479

Actions #7

Updated by Mr. Hudson over 12 years ago

Patch set 4 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479

Actions #8

Updated by Mr. Hudson over 12 years ago

Patch set 5 of change I760f80b8cfa2dcea8b554c24467f56b662d465d9 has been pushed to the review server.
It is available at http://review.typo3.org/5479

Actions #9

Updated by Steffen Gebert over 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 20 to 100
Actions #10

Updated by Steffen Gebert over 12 years ago

  • Category set to Image Cropping
  • Target version set to 4.5.7
Actions #11

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF