Review main Merged

72010[BUGFIX] Avoid calling quote with non-string value in QueryGenerator

Stefan Bürk CR +2 V +2 Easy +6 −2 updated 11/03/21, 20:37

Commit message

ext:lowlevel QueryGenerator calls quote(...) with non string value as
first parameter which ends in a E_DEPRECATED as underlaying quote(...)
method from PDO expects an string value as first parameter.

This patch casts the first parameter to string and add parameter type
string as quote type, as the places expected string enquoting.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Oli Bartsch +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Oli Bartsch +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1013

  1. Stefan Bürk uploaded patch set 1 10/30/21, 18:23

  2. core-ci voted on patch set 1 V +1 10/30/21, 18:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18682

  3. Andreas Kienast commented on patch set 1 CR -1 11/01/21, 10:42

    QueryGenerator.php:2450

    Is this really necessary? The default value for the 2nd argument is `ParameterType::STRING` which points to `PDO::PARAM_STR` anyway.
  4. Stefan Bürk commented on patch set 1 11/03/21, 15:31

    QueryGenerator.php:2450 Reply

    > Is this really necessary? The default value for the 2nd argument is `ParameterType::STRING` which points to `PDO::PARAM_STR` anyway. Sry, that's maybe more a personal thing from me. I'm more a fan of using explict settings, even if there are some defaults - lesson learnd over the last two decades. Defaults may change, which breaks the expectation here. So if underlaying code / packages change defaults code would not change behaviour magicly. Here my personally style went in. Will remove the explicict using of the default here. Further it make clear what is expected, and that there is a second argument. But have seen that using default argument values is omitted in the core or by most contributors. (Don't get me wrong, just wanted to explain what was the reason, not fighting the point here). You are right, currently it is technically not needed here atm. So I will remove it and push a change later after work reverting it. Thanks for the hint / question.
  5. Stefan Bürk commented on patch set 2 11/03/21, 18:46

    Published edit on patch set 1.
  6. core-ci voted on patch set 2 V +1 11/03/21, 19:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18812

  7. Stefan Bürk commented on patch set 2 11/03/21, 19:11

    QueryGenerator.php:2450 Reply

    Done
  8. Stefan Bürk commented on patch set 3 11/03/21, 20:13

    Published edit on patch set 2.
  9. Christian Kuhn voted on patch set 3 V +1 CR +1 11/03/21, 20:27

  10. Oli Bartsch voted on patch set 3 V +1 CR +1 11/03/21, 20:32

  11. core-ci voted on patch set 3 V +1 11/03/21, 20:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18826

  12. Anja Leichsenring voted on patch set 3 V +2 CR +2 11/03/21, 20:37

  13. Anja Leichsenring merged patch set 4 11/03/21, 20:37