Bug #88922

Memory unfriendly functions used for simple checks

Added by Andreas Fernandez 4 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-08-05
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The TYPO3 core uses strstr() and friends quite often to check the occurrence of a certain substring. This is not optimal, as the computed result is stored into RAM, but is not used at all.

Those occurrences may be replaced with strpos().

Associated revisions

Revision cde9c8c5 (diff)
Added by Andreas Fernandez 4 months ago

[BUGFIX] Use `strpos()` over `strstr()`

This patch replaces all usages of `strstr()` and its friends where the
existence of a certain substring is checked, but the result isn't used at
all with `strpos()`, which uses less memory.

Resolves: #88922
Releases: master
Change-Id: Ie45589ac9410e22e1b48e82dd8086eadb6d74107
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61445
Tested-by: TYPO3com <>
Tested-by: Anja Leichsenring <>
Tested-by: Frank Naegler <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Anja Leichsenring <>
Reviewed-by: Frank Naegler <>

History

#1 Updated by Gerrit Code Review 4 months ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61445

#2 Updated by Andreas Fernandez 4 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF