Issue Bug Closed

#106599htmlspecialchars(): Argument #1 ($string) must be of type string, float given

Benjamin Serfhos 04/23/25, 08:06 updated 08/12/25, 14:36

Description

In the ext:lowlevel there is a bug in the database integrity lookup.

when you select another dropdown for ‘where’ clause this conflict occurs:

(1/1) TypeError – htmlspecialchars(): Argument #1 ($string) must be of type string, float given
in ../vendor/typo3/cms-lowlevel/Classes/Controller/DatabaseIntegrityController.php line 1761

Reviews 2

Files 1

History 710

  1. Garvin Hicking commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2025-04-23T08:13:40+00:00" > 04/23/25, 08:13 </span>

    Thanks for the report. Do you have the full stacktrace?

    It can probably be fixed by replacing the mentioned line:

    $lineHTML[] = '  <input class="form-control form-control-clearable t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $fieldPrefix . '[inputValue]">';

    with:

    $lineHTML[] = '  <input class="form-control form-control-clearable t3js-clearable" type="text" value="' . htmlspecialchars((string)$conf['inputValue']) . '" name="' . $fieldPrefix . '[inputValue]">';

    but I have the feeling there might be more follow-up errors, so I’d like to reproduce which fields exactly may cause this.

    Which table exactly did you try to inspect, can you give steps to reproduce the error? Thanks!

  2. Benjamin Serfhos commented and changed attached Screen Recording 2025-04-23 at 11.16.28.mov <span data-processor="relativetime" data-value="2025-04-23T09:24:52+00:00" > 04/23/25, 09:24 </span>

    Steps to reproduce:
    1) Go to DB Check
    2) Select ‘Full search’
    3) Select on Search type: Advanced query
    4) Select redirects as table
    5) Query where Created At
    6) Change equals to `is greater than`

    Crash occurs, see screen recording.

    However while trying to find how to reproduce, i encountered another bug while debugging be_users…

    TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController::evaluateRelationDisplayWithLabels(): Argument #4 ($altLabelFieldName) must be of type string, null given, called in /var/www/html/vendor/typo3/cms-lowlevel/Classes/Controller/DatabaseIntegrityController.php on line 2013
    at TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController->evaluateRelationDisplayWithLabels(false, false, object(TYPO3\CMS\Core\Schema\Capability\LabelCapability), null, array(‘uid’ => 1, ‘title’ => ‘General (all users)’), array(), array(), ‘title’)

    This Controller has some bugs apparently :-)

  3. Benjamin Serfhos commented <span data-processor="relativetime" data-value="2025-04-23T09:28:52+00:00" > 04/23/25, 09:28 </span>

    Btw, to be able to try it again, you need to “Reset configuration and clear temporary data” in user settings to be able to use this module again.

  4. Garvin Hicking commented and changed status Needs Feedback Accepted <span data-processor="relativetime" data-value="2025-04-23T09:30:21+00:00" > 04/23/25, 09:30 </span>

    Thanks, that helps, I could reproduce it. It’s odd because at that point no “float” value has even been entered. Hm.

    The Controller was recently refactored (to fix even more bugs), so that could well be. Any help appreciated ;)

  5. Gerrit Code Review pushed patch set 1 for main to change 89207 status Accepted Under Review <span data-processor="relativetime" data-value="2025-04-23T19:07:13+00:00" > 04/23/25, 19:07 </span>

  6. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-05-07T08:35:09+00:00" > 05/07/25, 08:35 </span>

    Applied in changeset commit:921750c2b0beaa40cbd5b924d1aa4f2af6e67869.