WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/07/2007 05:29:15 AM (14 years ago)
Author:
markjaquith
Message:

Use strpos instead of strstr where ever possible, for speed. Props rob1n. fixes #3920

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/default/functions.php

    r4747 r4990  
    2626
    2727function kubrick_upper_color() {
    28     if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) {
     28    if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) {
    2929        parse_str(substr($url, strpos($url, '?') + 1), $q);
    3030        return $q['upper'];
     
    3434
    3535function kubrick_lower_color() {
    36     if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) {
     36    if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) {
    3737        parse_str(substr($url, strpos($url, '?') + 1), $q);
    3838        return $q['lower'];
Note: See TracChangeset for help on using the changeset viewer.