#5424 closed defect (bug) (invalid)
wpdb: use function_exists() instead of slower version_compare()
| Reported by: | DD32 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Optimization | Version: | 2.5 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Wpdb's escaping code currently compares the PHP version to determine if a function will be available or not.
function_exists('mysql_real_escape_string');
is about twice as fast as the current code(on testing of 1,000 iterations):
version_compare( phpversion(), '4.3.0' );
Attachments (1)
Change History (9)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
That code isn't even be running since we return on the line before. But, yes, function_exists is better for such things.