Dotclear


Ignore:
Timestamp:
08/31/13 15:33:57 (11 years ago)
Author:
Florent Cotton <florent.cotton@…>
Branch:
pingbacks
Message:

Découverte automatique : On passe toute la partie détection des pingbacks en premier lieu. Juste histoire de ne pas paraitre trop "legacy" (dumb-ass WP fanboys!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.trackback.php

    r1672 r1673  
    410410          } 
    411411           
    412           # No X-Pingback header ? OK, let's check for a trackback data chunk... 
     412          # No X-Pingback header. A link rel=pingback, maybe ? 
     413          $pattern_pingback = '!<link rel="pingback" href="(.*?)"( /)?>!msi'; 
     414           
     415          if (preg_match($pattern_pingback,$page_content,$m)) { 
     416               $pb_url = $m[1]; 
     417               if (filter_var($pb_url,FILTER_VALIDATE_URL) && preg_match('!^https?:!',$pb_url)) { 
     418                    return $pb_url.'|'.$url; 
     419               } 
     420          } 
     421 
     422          # No pingback ? OK, let's check for a trackback data chunk... 
    413423          $pattern_rdf = 
    414424          '/<rdf:RDF.*?>.*?'. 
     
    433443          } 
    434444           
    435           # Last call before the point of no return : a link rel=pingback, maybe ? 
    436           $pattern_pingback = '!<link rel="pingback" href="(.*?)"( /)?>!msi'; 
    437            
    438           if (preg_match($pattern_pingback,$page_content,$m)) { 
    439                $pb_url = $m[1]; 
    440                if (filter_var($pb_url,FILTER_VALIDATE_URL) && preg_match('!^https?:!',$pb_url)) { 
    441                     return $pb_url.'|'.$url; 
    442                } 
    443           } 
    444            
    445445          return null; 
    446446     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map