Review main Merged

70243[BUGFIX] Ensure getRecordTitle returns a string

Oli Bartsch CR +2 V +2 Easy +19 −6 updated 08/06/21, 08:38

Commit message

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.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • Jörg Bösche +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 67

  1. Oli Bartsch uploaded patch set 1 08/06/21, 01:07

  2. core-ci voted on patch set 1 V +1 08/06/21, 01:25 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/14183

  3. Benni Mack voted on patch set 1 V +1 CR +1 08/06/21, 07:09

  4. Jörg Bösche voted on patch set 1 CR +1 08/06/21, 07:36

  5. Jochen Roth voted on patch set 1 V +1 CR +1 08/06/21, 07:41

  6. Oli Bartsch voted on patch set 1 V +2 CR +2 08/06/21, 08:38

  7. Oli Bartsch merged patch set 2 08/06/21, 08:38