
Corriger le problème de feeds RSS sous WP 1.5.1
le Mercredi 11 mai 2005 à 11:29 par MattEt paf ! Deux jours après la mise à jour de WordPress, je me rends compte que tous les feeds RSS sont morts : page blanche, plus rien dans l’aggrégateur de Firefox… même SkyRSS Reader rendait copie blanche, emêchant les autres flux de s’afficher. Houston, on a un problème… Après une petite recherche sur les forums de WordPress, je me suis aperçu que je n’étais pas le seul dans ce cas et qu’il y avait même un patch disponible.
Le problème vient de la variable client_last_modified. Si elle est vide, wp-blog-header.php appelle la fonction strtotime(”"), qui retourne ‘00:00:00′. Il faut donc ajouter une nouvelle instruction (’$client_last_modified &&’) pour résoudre le problème. Voici donc la correction à apporter au fichier wp-blogheader.php : vers la ligne 140, recherchez :
if ( ($client_last_modified && $client_etag) ?
((strtotime($client_last_modified) >= strtotime($wp_last_modified)) && ($client_etag == $wp_etag)) :
((strtotime($client_last_modified) >= strtotime($wp_last_modified)) || ($client_etag == $wp_etag)) ) {
if ( preg_match(’/cgi/’,php_sapi_name()) ) {
header(’Status : 304 Not Modified’) ;
echo “\r\n\r\n” ;
et remplacez par :
if ( ($client_last_modified && $client_etag) ?
((strtotime($client_last_modified) >= strtotime($wp_last_modified)) && ($client_etag == $wp_etag)) :
(($client_last_modified && strtotime($client_last_modified) >= strtotime($wp_last_modified)) || ($client_etag == $wp_etag)) ) {
if ( preg_match(’/cgi/’,php_sapi_name()) ) {
header(’Status : 304 Not Modified’) ;
echo “\r\n\r\n” ;
Voilà ! Testé et approuvé. ;-)
Lien permanent





