61445[BUGFIX] Use `strpos()` over `strstr()`
Commit message
Review
-
Code review CR +2 Done
- Frank Nägler +2
- Oliver Klee +1
- Anja Leichsenring +1
-
Verified V +2 Done
- Frank Nägler +2
- Anja Leichsenring +1
- TYPO3com +1 CI
Issues 1
Files 34
- typo3/sysext/backend/Classes/Controller/NewRecordController.php+1 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php+1 −1
- typo3/sysext/backend/Classes/Utility/BackendUtility.php+1 −1
- typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php+1 −1
- typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php+1 −1
- typo3/sysext/core/Classes/Database/QueryGenerator.php+4 −4
- typo3/sysext/core/Classes/Database/QueryView.php+4 −4
- typo3/sysext/core/Classes/Database/ReferenceIndex.php+1 −1
- typo3/sysext/core/Classes/Database/SoftReferenceIndex.php+1 −1
- typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php+4 −8
- typo3/sysext/core/Classes/LinkHandling/LinkService.php7+1 −1
- typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php+4 −4
- typo3/sysext/core/Classes/TypoScript/TypoScriptService.php+1 −1
- typo3/sysext/core/Classes/Utility/VersionNumberUtility.php+1 −1
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php+6 −6
- typo3/sysext/frontend/Classes/ContentObject/TemplateContentObject.php+6 −6
- typo3/sysext/frontend/Classes/Controller/ShowImageController.php+1 −5
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php+3 −3
- typo3/sysext/impexp/Classes/Import.php+1 −1
- typo3/sysext/impexp/Classes/ImportExport.php+1 −1
Show 14 more files
- typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php+2 −2
- typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php+1 −1
- typo3/sysext/indexed_search/Classes/Indexer.php+4 −4
- typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/AbstractCoreMatcher.php+2 −2
- typo3/sysext/install/Classes/ExtensionScanner/Php/CodeStatistics.php+2 −2
- typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php+1 −1
- typo3/sysext/install/Classes/FolderStructure/FileNode.php+1 −1
- typo3/sysext/install/Classes/FolderStructure/LinkNode.php+1 −1
- typo3/sysext/install/Classes/Service/ExtensionConfigurationService.php+1 −1
- typo3/sysext/install/Classes/SystemEnvironment/Check.php+1 −1
- typo3/sysext/lowlevel/Classes/Integrity/DatabaseIntegrityCheck.php+1 −1
- typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php+2 −2
- typo3/sysext/recordlist/Classes/Browser/FolderBrowser.php+1 −1
- typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php+1 −1
Review log 1314
-
Andreas Kienast uploaded patch set 1 08/05/19, 14:36
-
TYPO3com voted on patch set 1 V +1 08/05/19, 14:48 Completed build in 11m 45s on Mon, 5 Aug, 02:48 PM Test Summary: 47172 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35598
-
Oliver Klee commented on patch set 1 CR -1 08/05/19, 17:02
-
Andreas Kienast commented on patch set 1 08/05/19, 17:21
LinkService.php:118ReplyI'm not sure, since both "false" and "0" are not valid in an URN. I don't want to change too much of the original code to avoid nasty regressions. -
Oliver Klee commented on patch set 1 08/06/19, 11:14
LinkService.php:118ReplyI think you might have misunderstood my comment. I was referring to change the code like this: strpos($urn, '://') -> strpos($urn, '://') !== false -
Andreas Kienast commented on patch set 1 08/06/19, 11:32
LinkService.php:118ReplyNo, I understood you correctly. This very change interchanges stripos() with strpos(), where the `!== false` check was missing as well. Again, an adjustment is a change of behavior of the code block which I refrain to do. -
Oliver Klee commented on patch set 1 08/06/19, 13:17
LinkService.php:118ReplyIf I see this correctly, you have added the === false or !== false in all other occurrences as well. Why add it in the other places, and not here? -
Andreas Kienast commented on patch set 1 08/06/19, 13:31
LinkService.php:118ReplyBecause those were calls to `strstr()` and alike before, that behave completely differently than strpos() does. -
Oliver Klee commented on patch set 1 CR +1 08/06/19, 15:11
LinkService.php:118Reply UnresolvedAh, now I see. Thanks. -
Claus Due commented on patch set 1 08/15/19, 07:13
Nearly all cases of "stripos" can just as well be "strpos" which might be easier for people to understand; whenever "stripos() !== false" is used it is interchangeable with "strpos() !== false". For clarity and convention it might be best to homogenise every call that simply scans for presence of a byte, to use "strpos", and only ever use "stripos" when there is a performance concern, e.g. likelihood of encountering match in huge string is higher from end than start of string. -
Claus Due commented on patch set 1 08/15/19, 07:15
> Patch Set 1: > > Nearly all cases of "stripos" can just as well be "strpos" which might be easier for people to understand; whenever "stripos() !== false" is used it is interchangeable with "strpos() !== false". > > For clarity and convention it might be best to homogenise every call that simply scans for presence of a byte, to use "strpos", and only ever use "stripos" when there is a performance concern, e.g. likelihood of encountering match in huge string is higher from end than start of string. Nevermind, I was thinking of strrpos. -
Anja Leichsenring voted on patch set 1 V +1 CR +1 08/19/19, 07:22
-
Frank Nägler voted on patch set 1 V +2 CR +2 08/23/19, 09:54
-
Frank Nägler merged patch set 2 08/23/19, 09:54
LinkService.php:118