82638[!!!][TASK] Add `ExpressionBuilder` method type hints
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 3
Files 42
- typo3/sysext/backend/Classes/Controller/Page/SortSubPagesController.php+1 −1
- typo3/sysext/backend/Classes/Controller/NewRecordController.php+2 −2
- typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php+3 −3
- typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php+2 −2
- typo3/sysext/backend/Classes/History/RecordHistory.php+2 −2
- typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php+7 −7
- typo3/sysext/backend/Classes/Tree/Repository/PageTreeRepository.php+1 −1
- typo3/sysext/backend/Classes/Utility/BackendUtility.php+9 −9
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php+4 −4
- typo3/sysext/core/Classes/Database/Query/Expression/ExpressionBuilder.php+24 −26
- typo3/sysext/core/Classes/Database/Query/Restriction/DeletedRestriction.php+1 −1
- typo3/sysext/core/Classes/Database/Query/Restriction/EndTimeRestriction.php+2 −2
- typo3/sysext/core/Classes/Database/Query/Restriction/HiddenRestriction.php+1 −1
- typo3/sysext/core/Classes/Database/Query/Restriction/PagePermissionRestriction.php+5 −5
- typo3/sysext/core/Classes/Database/Query/Restriction/RootLevelRestriction.php+1 −1
- typo3/sysext/core/Classes/Database/Query/Restriction/StartTimeRestriction.php+1 −1
- typo3/sysext/core/Classes/Database/Query/Restriction/WorkspaceRestriction.php+4 −4
- typo3/sysext/core/Classes/Database/ReferenceIndex.php+3 −3
- typo3/sysext/core/Classes/Database/RelationHandler.php+1 −1
- typo3/sysext/core/Classes/DataHandling/Localization/DataMapProcessor.php+1 −1
Show 22 more files
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+9 −9
- typo3/sysext/core/Classes/Domain/Repository/PageRepository.php+16 −16
- typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/StorageRestriction.php+1 −1
- typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php+4 −4
- typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102875-ExpressionBuilderChanges.rst+19 −4
- typo3/sysext/core/Tests/Unit/Database/Query/Expression/ExpressionBuilderTest.php+6 −6
- typo3/sysext/core/Tests/Unit/Database/Query/QueryBuilderTest.php+4 −4
- typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php+1 −1
- typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php+12 −12
- typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php+3 −3
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php+4 −4
- typo3/sysext/impexp/Classes/Export.php+1 −1
- typo3/sysext/indexed_search/Classes/Controller/AdministrationController.php+2 −2
- typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php+5 −5
- typo3/sysext/install/Classes/Updates/FeLoginModeExtractionUpdate.php+1 −1
- typo3/sysext/lowlevel/Classes/Command/DeletedRecordsCommand.php+1 −1
- typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php+1 −1
- typo3/sysext/lowlevel/Classes/Service/CleanUpLocalProcessedFilesService.php+1 −1
- typo3/sysext/recycler/Classes/Domain/Model/DeletedRecords.php+1 −1
- typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php+1 −1
- typo3/sysext/scheduler/Classes/Domain/Repository/SchedulerTaskRepository.php+2 −2
- typo3/sysext/workspaces/Classes/Service/WorkspaceService.php+1 −1
Review log 911
-
Stefan Bürk uploaded patch set 1 01/24/24, 22:32
-
core-ci voted on patch set 1 V +1 01/24/24, 22:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52115
-
Stefan Bürk uploaded patch set 2
V +101/25/24, 07:55 -
core-ci voted on patch set 2 V +1 01/25/24, 08:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52132
-
Oliver Klee voted on patch set 2 CR +1 V +1 01/25/24, 08:56
-
Benni Mack commented on patch set 2 01/25/24, 09:30
tbh, this is going to be massively breaking for basically everyone. I'd rather have our ExprBuilder typecast to string and allow mixed still. This is really a case where I consider strict types (from Doctrine) a bad idea. -
Stefan Bürk commented on patch set 2 CR -1 01/25/24, 09:46
Reply
Basically - no. Directly passing values is wrong anyway and proper placeholder or quoting used which ends up in strings. Granted, that means I should have changed the adjustments to use $expr->literal(), $connection->quote() or at least $queryBuilder->createNamedParameter() all over the place (which would required to adjust tests expecting and testing on the exact generated sql statement string)). However, will change this patch to proper auto-casting instead as non breaking. But we should make it a rule to avoid these direct value usings in facour of proper quoting in the future. I will create a followup patches in smaller peaces to get that usages streamlined at least in the core. Should we add a important or just document it in the depths of the documentation as a tip/note/caution/warning that people prepare for it ? This should be changed as dealing with non-strings for expression is wrong - v14 than ? Adding deprecation would be a logging spammer I would say. TBH - it's only breaking if not properly quoted/literal used for the values. Passing statements as value are strings anyway in normal circumstances. -
Oliver Hader commented on patch set 2 CR -1 01/25/24, 09:57
Changing from a secure ``` $expressionBuilder->eq($fieldName, (int)$this->searchString), ``` to ``` $expressionBuilder->eq($fieldName, (string)$this->searchString), ``` raises the change to introduce a lot of new SQL injection vectors. DBAL seems to expect that those variables were passed through `createNamedParameter` before (which results in a string). Thus: Basically a `-1` from my side for security concerns -
Oliver Hader commented on patch set 2 01/25/24, 09:58
Reply
*should have been `raises the chance` -
Stefan Bürk commented on patch set 2 CR -2 01/25/24, 10:14
Reply
Basically, this does not change anything imo as the string cast is done in ExpressionBuilder->comparision() due to the strinc concatination anyway - just having it explicitly done now. That means that is not more or less secure than the current state. I will abandon this patch and work through the core with dedicated patches to streamline this in all places beforehand (and also as backports). Making it right then. Making the strict types has been discussed away for now anyway. Will go to abandon this patch than. -
Stefan Bürk abandoned the change 01/25/24, 10:29