Bug #77178

TCA type='text' with 'readOnly'=true renders newlines as <br /> tags

Added by Viktor Livakivskyi about 3 years ago. Updated about 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2016-07-20
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

As outlined in a title, the problem is with readOnly state of textareas in TCA.

TCA without readOnly

'comment' => [
    'exclude' => 0,
    'label'   => 'Coment',
    'config'  => [
        'type'     => 'text',
    ],
]

renders such a picture:

TCA with readOnly TRUE

'comment' => [
    'exclude' => 0,
    'label'   => 'Coment',
    'config'  => [
        'type'     => 'text',
        'readOnly' => true
    ],
]

renders like this:

In case #32412 is implemented, this may lead to funny results on save of form with readOnly textares.

TYPO3 7.6.9

tca-text.png View (3.1 KB) Viktor Livakivskyi, 2016-07-20 16:44

tca-text-readonly.png View (3.46 KB) Viktor Livakivskyi, 2016-07-20 16:44

History

#1 Updated by Dennis Römmich about 3 years ago

Actually there is an option called 'pass_content'

'comment' => [
    'exclude' => 0,
    'label'   => 'Coment',
    'config'  => [
        'type'     => 'text',
        'readOnly' => true,
        'pass_content' => true
    ],
]

which prevents textareas acting like this.

The questions are: For what reason does this option exist? And is it possible to inject xss when I use it?

#2 Updated by Viktor Livakivskyi about 3 years ago

Dennis, thank you for the tip.

Funny, that pass_content option shoudl only be available to type "none", according to documentation

So, not sure is it another bug or documentation is not up to date.

#3 Updated by Riccardo De Contardi about 2 years ago

I guess documentation is correct; as far as I can see pass_content should be available only for type="none"

(see sysext\backend\Classes\Form\Element\NoneElement.php)

Also available in: Atom PDF