Project

General

Profile

Actions

Bug #77178

closed

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

Added by Viktor Livakivskyi over 7 years ago. Updated about 4 years ago.

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

0%

Estimated time:
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


Files

tca-text.png (3.1 KB) tca-text.png Viktor Livakivskyi, 2016-07-20 16:44
tca-text-readonly.png (3.46 KB) tca-text-readonly.png Viktor Livakivskyi, 2016-07-20 16:44
Bildschirmfoto 2020-03-04 um 15.18.24.png (10.5 KB) Bildschirmfoto 2020-03-04 um 15.18.24.png readonly Georg Ringer, 2020-03-04 15:18
Bildschirmfoto 2020-03-04 um 15.18.40.png (9.77 KB) Bildschirmfoto 2020-03-04 um 15.18.40.png editable Georg Ringer, 2020-03-04 15:19
Actions #1

Updated by Dennis Römmich over 7 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?

Actions #2

Updated by Viktor Livakivskyi over 7 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.

Actions #3

Updated by Riccardo De Contardi over 6 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)

Actions

Also available in: Atom PDF