In-Portal Issue Tracker - In-Portal CMS
|
Viewing Issue Advanced Details |
|
ID:
|
Category:
|
Type:
|
Reproducibility:
|
Date Submitted:
|
Last Update:
|
236 |
[In-Portal CMS] Optimization |
task |
always |
2009-08-22 06:09 |
2010-01-11 22:05 |
|
Reporter:
|
alex |
Platform:
|
|
|
Assigned To:
|
alex |
OS:
|
|
|
Priority:
|
normal |
OS Version:
|
|
|
Status:
|
closed |
Product Version:
|
5.0.0 |
|
Product Build:
|
|
Resolution:
|
fixed |
|
|
ETA:
|
none |
Fixed in Version:
|
5.0.2 |
|
Reference:
|
|
Change Log Message:
|
|
Estimate Points:
|
0 |
|
Summary:
|
0000236: Don't use preg_replace for removing trailing words in strings |
Description:
|
Currently in some places we are using mentioned later code to strip trailing word from string:
$pos_sql = preg_replace('/(.*) OR $/', '\\1', $pos_sql)
This is not very efficient and should be replaced with code like this:
$pos_sql = substr($pos_sql, -2); // "-2" is "(-1) * strlen('OR')" |
Steps To Reproduce:
|
|
Additional Information:
|
|
Relationships | related to | 0000273 | closed (5.0.3) | alex | Get rid of ereg* functions usage, because they are slow and are deprecated since PHP 5.3 |
|
Attached Files:
|
review preg_replace usage.patch (8,746) 2009-10-04 11:43 http://tracker.in-portal.org/file_download.php?file_id=66&type=bug review preg_replace usage (in-link).patch (1,007) 2009-10-06 02:26 http://tracker.in-portal.org/file_download.php?file_id=71&type=bug |
|
Issue History |
Date Modified |
Username |
Field |
Change |
2010-01-11 22:05 |
Dmitry |
Note Added: 0001373 |
|
2010-01-11 22:05 |
Dmitry |
Status |
resolved => closed |
2009-10-20 04:04 |
alex |
Changeset attached |
5.0.x r12706 |
2009-10-20 04:04 |
alex |
Note Added: 0000931 |
|
2009-10-20 04:04 |
alex |
Status |
reviewed and tested => resolved |
2009-10-20 04:04 |
alex |
Fixed in Version |
=> 5.0.2 |
2009-10-20 04:04 |
alex |
Resolution |
open => fixed |
2009-10-20 03:56 |
alex |
Changeset attached |
5.0.x r12705 |
2009-10-18 02:14 |
Dmitry |
Note Added: 0000913 |
|
2009-10-18 02:14 |
Dmitry |
Assigned To |
Dmitry => alex |
2009-10-18 02:14 |
Dmitry |
Status |
needs testing => reviewed and tested |
2009-10-10 08:05 |
alex |
Note Added: 0000868 |
|
2009-10-10 08:05 |
alex |
Assigned To |
alex => Dmitry |
2009-10-10 08:05 |
alex |
Status |
needs feedback => needs testing |
2009-10-08 18:20 |
Dmitry |
Note Added: 0000855 |
|
2009-10-08 18:20 |
Dmitry |
Status |
active => needs feedback |
2009-10-08 18:19 |
Dmitry |
Status |
needs feedback => active |
2009-10-08 18:19 |
Dmitry |
Assigned To |
Dmitry => alex |
2009-10-08 14:08 |
alex |
Note Added: 0000840 |
|
2009-10-08 14:08 |
alex |
Assigned To |
alex => Dmitry |
2009-10-08 12:13 |
Dmitry |
Note Added: 0000838 |
|
2009-10-08 12:13 |
Dmitry |
Assigned To |
!COMMUNITY => alex |
2009-10-08 12:13 |
Dmitry |
Status |
needs testing => needs feedback |
2009-10-06 14:24 |
alex |
Type |
bug report => task |
2009-10-06 02:26 |
alex |
File Added: review preg_replace usage (in-link).patch |
|
2009-10-04 11:43 |
alex |
Time Estimate Removed |
2 => |
2009-10-04 11:43 |
alex |
Assigned To |
alex => !COMMUNITY |
2009-10-04 11:43 |
alex |
Status |
active => needs testing |
2009-10-04 11:43 |
alex |
File Added: review preg_replace usage.patch |
|
2009-10-03 07:52 |
administrator |
Status |
reviewed and tested => active |
2009-09-30 06:59 |
alex |
Assigned To |
andrew => alex |
2009-09-30 06:58 |
alex |
Status |
active => reviewed and tested |
2009-09-30 06:58 |
alex |
Assigned To |
=> andrew |
2009-09-23 13:15 |
alex |
Time Estimate Added |
2 |
2009-09-23 13:15 |
alex |
Note Added: 0000530 |
|
2009-09-20 15:11 |
alex |
Target Version |
5.1.0 => 5.0.2 |
2009-09-14 15:39 |
alex |
Relationship added |
related to 0000273 |
2009-08-24 00:15 |
Dmitry |
Target Version |
=> 5.1.0 |
2009-08-22 06:09 |
alex |
New Issue |
|
Notes |
|
(0000530)
|
alex
|
2009-09-23 13:15
|
|
Plan:
1. 69 files, that contain preg_replace to analyze
2. when appropriate replace with trim or substr. |
|
|
(0000838)
|
Dmitry
|
2009-10-08 12:13
|
|
Please describe main places where and how to test this. |
|
|
(0000840)
|
alex
|
2009-10-08 14:08
|
|
Places are listed in patch, how to test is dependent on place where given file is used. Should I describe each changed line related to it's usage place in admin/front-end? |
|
|
(0000855)
|
Dmitry
|
2009-10-08 18:20
|
|
Well, yes - I think it's the only way to properly know which parts of the system were effected.
For example, changes in "units/helpers/multilanguage_helper.php" and other places considered very critical and need thorough testing...
Please be so kind and list all places that can be effected by this page so we can test the patch correctly.
|
|
|
(0000868)
|
alex
|
2009-10-10 08:05
|
|
Here they are, but I've really expected that it's obvious by method name and class, that it does. For each method I've described what method does and what of it's work is affected by attached patch.
kDBItem::GetKeyClause - used to create where clause for loading database item
kEmailSendingHelper::SetMultipleEncodedEmailHeader - sets given multiple emails to given header, like To, Cc, Bcc (not in use)
kEmailSendingHelper::AddRecipient - used to add one more recipient to given header, like To, Cc, Bcc (during email composing)
AdminEventsHandler::insert_data - used during backup file creation to remove trailing commas
kCatDBItemExportHelper::storeCache - stores temporary import data during catalog data import (what was imported as what)
kCatDBItemExportHelper::getCustomSQL - used for creating export sql for catalog data export
kCatDBItemExportHelper::getExportSQL - used for creating export sql for catalog data export
kCatDBItemExportHelper::processCurrentItem - used for detecting unique items (insert new or update existing) during catalog data import
kCatDBItemExportHelper::getMaxCategoryLevel - used for category path forming during catalog data export
CategoryHelper::replacePageIds - used for replacing @@ID@@ with page url (preg was used, where it wasn't required)
LanguageImportHelper::performExport - exporting phrases/email events only from chosen modules (on export screen)
kMultiLanguageHelper::deleteField - deletes fields in custom data tables, when actual custom field is deleted
SpamHelper::GetKeyClause - used to create where clause for detecting spam creation attempts (e.g. vote multiple times a day for the same item and so on)
PermissionsTagProcessor::PrintPermissions - used for inheritance icon/checkbox detection
StatisticsEventHandler::SetCustomQuery - module filter for statistics display (not in use)
LinkEventHandler::OnMerge - grouping clause forming for duplicate link merging |
|
|
(0000913)
|
Dmitry
|
2009-10-18 02:14
|
|
|
|
(0000931)
|
alex
|
2009-10-20 04:04
|
|
Fix committed to 5.0.x branch. Commit Message:
Fixes 0000236: Don't use preg_replace for removing trailing words in strings |
|
|
(0001373)
|
Dmitry
|
2010-01-11 22:05
|
|
|