Skip to content
Snippets Groups Projects
Commit f9b5ff59 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Ensure getRecordTitle returns a string

BackendUtility::getRecordTitle() should return a string (as
the return type annotation suggest). Especially because the
return value is usually directly passed to htmlspecialchars(),
which again requires a string to be given.

Since BackendUtility::getRecordTitle() was missing some
typecasts, it was possible that e.g. an integer was returned.
This then failed in classes, defining strict mode.

An example for such scenario: Having a table, which
defines the `uid` as `label` field. getRecordTitle is using
getProcessedValue(), which has a guard clause to directly
return the input value, in case the label field is `uid`. This
would then usually (depending on DBMS) return an integer.

This is now fixed by applying type casts to the relevant places.

Resolves: #94726
Releases: master
Change-Id: Ie02837ff5e55f369ff8ddf1f3e5098e636f475bb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70243


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarJochen <rothjochen@gmail.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarJörg Bösche <typo3@joergboesche.de>
Reviewed-by: default avatarJochen <rothjochen@gmail.com>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent 9e2f40e3
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment