Changeset 1156

Show
Ignore:
Timestamp:
01/08/06 00:17:40 (5 years ago)
Author:
jmudry
Message:

Workaround for a PHP bug with strtotime and RFC822 dates. Correction for ticket #328

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rss/util.php

    r1155 r1156  
    261261            elseif (array_key_exists('pubdate', $item)) { 
    262262                // RSS 2.0 (?) 
    263                 $cDate = strtotime($item['pubdate']); 
     263                // We use the second param of strtotime here as a workaround 
     264                // of a PHP bug with strtotime. If the pubdate field doesn't 
     265                // contain seconds, the strtotime function will use the current 
     266                // time to fill in seconds in PHP4. This interferes with the 
     267                // update mechanism of gregarius. See ticket #328 for the full 
     268                // gory details. Giving a known date as a second param to  
     269                // strtotime fixes this problem, hence the 0 here. 
     270                $cDate = strtotime($item['pubdate'], 0); 
    264271            } 
    265272            elseif (array_key_exists('created', $item)) {