Project

General

Profile

Actions

Bug #23099

closed

t3lib_db->escapeStrForLike() performance

Added by Caspar Stuebs over 14 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-07-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The function t3lib_db->escapeStrForLike() uses preg_replace to escape the values '%' and '_' with an '\' for a sql-like-statement.

preg_replace takes a lot of recources and is not necessary for such a simple replacement.

solution: use str_replace instead.

(issue imported from #M14997)


Files

bug_14997.patch (411 Bytes) bug_14997.patch Administrator Admin, 2010-07-04 22:49
14997-benchmark.php (1.43 KB) 14997-benchmark.php Administrator Admin, 2010-09-05 16:33
14997_v3.diff (990 Bytes) 14997_v3.diff Administrator Admin, 2010-09-30 18:30
Actions #1

Updated by Marcus Krause about 14 years ago

Added a benchmark script that compares usage of preg_replace(), str_replace() and addcslashes().

Actions #2

Updated by Francois Suter about 14 years ago

Committed v3 to trunk in revision 8940

Actions #3

Updated by Susanne Moog over 13 years ago

  • Target version deleted (4.5.0)
Actions

Also available in: Atom PDF