Dotclear


Ignore:
Timestamp:
08/13/13 15:05:35 (11 years ago)
Author:
Pascal Chevrel <pascal.chevrel@…>
Branch:
Ticket1526-depuis2.5
Children:
1367:ef0eda092a94, 1400:739ac39d1d51
Message:

Ticket #1526 : antispam, extract https links from comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/filters/class.dc.filter.linkslookup.php

    r1179 r1366  
    6464     private function getLinks($text) 
    6565     { 
    66           $res = array(); 
    67            
    68           # href attribute on "a" tags 
    69           if (preg_match_all('/<a ([^>]+)>/ms', $text, $match, PREG_SET_ORDER)) 
    70           { 
    71                for ($i = 0; $i<count($match); $i++) 
    72                { 
    73                     if (preg_match('/href="(http:\/\/[^"]+)"/ms', $match[$i][1], $matches)) { 
    74                          $res[] = $matches[1]; 
    75                     } 
    76                } 
    77           } 
    78            
    79           return $res; 
     66          // href attribute on "a" tags is second match 
     67          preg_match_all('|<a.*?href="(http.*?)"|', $text, $parts); 
     68 
     69          return $parts[1]; 
    8070     } 
    8171} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map