#3920 closed enhancement (fixed)
Use strpos() instead of strstr() where appropriate
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | 2.1.2 |
Component: | Optimization | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
According to the PHP manual page, strpos() is "faster and less memory intensive" (http://us2.php.net/strstr) than strstr() if you just want to know whether a string contains another string.
After talking with Ryan, I made a patch that changes every strstr() call to a strpos() (*except* where appropriate for strstr()).
Attachments (3)
Change History (10)
#1
@
18 years ago
- Keywords has-patch added
- Status changed from new to assigned
- Type changed from defect to enhancement
#3
@
18 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
There's a bug in this patch, I'll fix and submit a new one in a minute.
#4
@
18 years ago
- Resolution set to fixed
- Status changed from reopened to closed
Attached patch 3920.3
to fix typo on line 280 of pluggable.php
from patch 3920.2
.
This ticket was mentioned in PR #3971 on WordPress/wordpress-develop by @flixos90.
2 years ago
#7
- Keywords has-unit-tests added
Not intended for commit.
This PR is solely for QA and performance testing of #3920. It is based on the same code, but also includes initial usage of that new API, which were taken from #3914 and https://github.com/dmsnell/wordpress-develop/pull/1.
Never mind the incorrect file name, I swear I'm slightly dyslexic sometimes.