[TYPO3-core] RFC #14997: Performance: t3lib_db->escapeStrForLike() is using preg_replace, which is not necessary

Martin Kutschker masi-no at spam-typo3.org
Mon Jul 5 10:09:28 CEST 2010


Am 05.07.2010 08:30, schrieb Xavier Perseguers:
> Hi Caspar,
> 
>> Type: Performance
>>
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=14997
>>
>> Branches:
>> Trunk
>>
>> Problem:
>> The function t3lib_db->escapeStrForLike() is using preg_replace to escape
>> the values '%' and '_' with a '\' 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.
> 
> First of all, thanks for your different DB patches.
> 
> I'll have a look at all those DB-related patch soon.
> 
> May I kindly ask you to create .diff files instead of .patch and make sure they are attached as
> text/plain to your posts? This helps a lot with mail readers such as Thunderbird or Postbox that
> allow inline viewing of text attachments with syntax highlighting.

For me .diff and .patch worked fine in Thunderbird. The Colored Diff TB add-on seems to handle even
application/octet-stream. But I agree that a text/* MIME type makes more sense.

Masi


More information about the TYPO3-team-core mailing list