Make WordPress Core


Ignore:
Timestamp:
03/07/2007 05:29:15 AM (18 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/comment-template.php

    r4934 r4990  
    240240function trackback_rdf($timezone = 0) {
    241241    global $id;
    242     if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) {
    243     echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    244             xmlns:dc="http://purl.org/dc/elements/1.1/"
    245             xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    246         <rdf:Description rdf:about="';
    247     the_permalink();
    248     echo '"'."\n";
    249     echo '    dc:identifier="';
    250     the_permalink();
    251     echo '"'."\n";
    252     echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n";
    253     echo '    trackback:ping="'.trackback_url(0).'"'." />\n";
    254     echo '</rdf:RDF>';
     242    if (strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false) {
     243        echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     244                xmlns:dc="http://purl.org/dc/elements/1.1/"
     245                xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
     246            <rdf:Description rdf:about="';
     247        the_permalink();
     248        echo '"'."\n";
     249        echo '    dc:identifier="';
     250        the_permalink();
     251        echo '"'."\n";
     252        echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n";
     253        echo '    trackback:ping="'.trackback_url(0).'"'." />\n";
     254        echo '</rdf:RDF>';
    255255    }
    256256}
Note: See TracChangeset for help on using the changeset viewer.