Project

General

Profile

Actions

Bug #87568

closed

Validation of ViewHelper arguments does not detect/cast "invalid" integers (or the image processing stack misses a check)

Added by S P almost 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2019-01-29
Due date:
% Done:

0%

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

Description

(I reported for TYPO3 9, but it is already present in TYPO3 8 and even probably earlier)

I noticed this in f.uri.image on the line
$this->registerArgument('maxWidth', 'int', 'maximum width of the image');

If you pass for example maxWidth: '1024' the image gets processed, but if you pass maxWidth: '1024px' (notice the "px") just "nothing happens" when the image should be processed.

I dumped the contents of the variables in the ViewHelper and the integer(!) maxWidth just holds the string(!) "1024px". But it should either cast (leading to the integer 1024) or throwing an exception about mismatching types.

I'm not sure if this is actually intended behaviour. If it's intended than this is a bug/annoyance in the image processing stack, which does not handle values like "1024px" correctly (it silently skips it), here a cast or exception would be appropriate as well.

Actions

Also available in: Atom PDF