Issue Bug Closed

#94562Link field - insufficiently checked input leads to reference index error

Heiko Nöthen 07/15/21, 06:41 updated 12/02/25, 14:33

Description

Description:

Editors try to enter a phone number without using the wizard next to the link field. This causes errors like the following when saving the content element and also during referenceindex:update.

An exception occurred while executing ‘INSERT INTO `sys_refindex` (`tablename`, `recuid`, `field`, `flexpointer`, `softref_key`, `softref_id`, `sorting`, `deleted`, `workspace`, `ref_table`, `ref_uid`, `ref_string`, `hash`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [“sys_file_reference”, 273664,
“link”, “”, “typolink”, “091c6845bc9ae493200c100e8a92c110:0”, -1, 0, 0, “pages”, 1234567890, “”, “27a9027f6e7866acd34f158860fc865d”]:

Out of range value for column ‘ref_uid’ at row 1

This occures in TYPO3 10 and TYPO3 11.

To reproduce this problem

- Create a content element (with image field).
- In the file reference / image use the link field or use the content element link field and enter 012345678910.
- Optional: start the cli -> referenceindex:update

The number is interpreted as a content id / ref_uid.

Reviews 6

History 1116

  1. Sybille Peters commented <span data-processor="relativetime" data-value="2021-10-25T19:05:00+00:00" > 10/25/21, 19:05 </span>

    I could reproduce the problem with your description in latest master (11-dev).

    The exception also occurs whenever the content element is modified in any way later.

  2. Dennis Metz commented <span data-processor="relativetime" data-value="2022-05-30T07:43:01+00:00" > 05/30/22, 07:43 </span>

    I have the same problem with a pure link field in a separate table.
    Here, too, an attempt is made to make an ID out of the telephone number.

    'link' => [
                'exclude' => false,
                'label' => 'LINKFELD',
                'config' => [
                    'type' => 'input',
                    'renderType' => 'inputLink',
                    'size' => 20,
                    'max' => 1024,
                    'fieldControl' => [
                        'linkPopup' => [
                            'options' => [
                                'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_reference.link',
                            ],
                        ],
                    ],
                    'softref' => 'typolink',
                ],
            ],
  3. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2024-04-07T19:47:16+00:00" > 04/07/24, 19:47 </span>

    On TYPO3 12 and 13 I got an exception with the following test:

    1) Create a page
    2) Create a CE (e.g. CType = header)
    3) paste into the Link [header_link] field the number: 012345678910
    4) Save it

    Result

    An exception occurs:

    (1/3) #1264 Doctrine\DBAL\Exception\DriverException
    An exception occurred while executing a query: Out of range value for column 'ref_uid' at row 1
    
    in /var/www/html/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 117

    By the way: the number is saved anyway…

    You can avoid the issue by pasting in the field: tel:012345678910

    It is better to pull out a message error (like: “link type not recognized” or whatever) instead of throwing an exception.

    would it be a good idea that the field should validate only strings entered that begins with

    t3://
    http(s)://
    tel:
    mailto:

    ?

  4. Christian Kuhn commented <span data-processor="relativetime" data-value="2024-11-20T15:19:39+00:00" > 11/20/24, 15:19 </span>

    confirmed. easy to reproduce since at least v11 to current main (v14). will have a look.

  5. Gerrit Code Review pushed patch set 1 for main to change 87101 status Accepted Under Review <span data-processor="relativetime" data-value="2024-11-20T15:23:03+00:00" > 11/20/24, 15:23 </span>

  6. Christian Kuhn commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2024-11-20T20:00:09+00:00" > 11/20/24, 20:00 </span>

    Applied in changeset commit:220a6658757fdbc531b022054cc95927e45de38e.