WordPress.org

Plugin Directory

Changeset 1729289 for feedwordpress


Ignore:
Timestamp:
09/13/17 12:14:30 (5 weeks ago)
Author:
radgeek
Message:

Quick bump - Normalize newly-minted normalized guids to http, but match normalized guids entirely regardless of http/https protocol prefix

Location:
feedwordpress/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • feedwordpress/trunk/syndicatedpost.class.php

    r1729270 r1729289  
    610610        elseif ((strlen(esc_url($guid)) == 0) or (esc_url($guid) != $guid)) : 
    611611            $guid = SyndicatedPost::normalize_guid_prefix().md5($guid); 
     612        endif; 
     613        $guid = trim($guid); 
     614         
     615        return $guid; 
     616    } /* SyndicatedPost::normalize_guid() */ 
     617 
     618    static function alternative_guid_prefix () { 
     619        $url = trailingslashit(home_url(/*path=*/ '', /*scheme=*/ 'https')); 
     620        return apply_filters('syndicated_item_guid_normalized_prefix', $url . '?guid='); 
     621    } 
     622    static function alternative_guid ($guid) { 
     623        $guid = trim($guid); 
     624        if (preg_match('/^[0-9a-z]{32}$/i', $guid)) : // MD5 
     625            $guid = SyndicatedPost::alternative_guid_prefix().strtolower($guid); 
     626        elseif ((strlen(esc_url($guid)) == 0) or (esc_url($guid) != $guid)) : 
     627            $guid = SyndicatedPost::alternative_guid_prefix().md5($guid); 
    612628        endif; 
    613629        $guid = trim($guid); 
  • feedwordpress/trunk/syndicationdataqueries.class.php

    r1729270 r1729289  
    4848                if (preg_match('/^[0-9a-f]{32}$/i', $guid)) : 
    4949                    $seek[] = SyndicatedPost::normalize_guid_prefix().$guid; 
     50                    $seek[] = SyndicatedPost::alternative_guid_prefix().$guid; 
    5051                endif; 
    5152 
     
    5556                if ($guid != $nGuid) : 
    5657                    $seek[] = $nGuid; 
     58                    $seek[] = SyndicatedPost::alternative_guid($guid); 
    5759                endif; 
    5860                 
Note: See TracChangeset for help on using the changeset viewer.