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-includes/post.php

    r4983 r4990  
    11991199
    12001200function is_local_attachment($url) {
    1201     if ( !strstr($url, get_bloginfo('url') ) )
    1202         return false;
    1203     if ( strstr($url, get_bloginfo('url') . '/?attachment_id=') )
     1201    if (strpos($url, get_bloginfo('url')) === false)
     1202        return false;
     1203    if (strpos($url, get_bloginfo('url') . '/?attachment_id=') !== false)
    12041204        return true;
    12051205    if ( $id = url_to_postid($url) ) {
Note: See TracChangeset for help on using the changeset viewer.