[SPIP] ~maj v3.0.14-->v3.0.17
[ptitvelo/web/www.git] / www / ecrire / public / cacher.php
index 13380c1..ab8d1d9 100644 (file)
@@ -111,6 +111,15 @@ function gunzip_page(&$page) {
 /// http://doc.spip.org/@cache_valide
 function cache_valide(&$page, $date) {
 
+       // Apparition d'un nouvel article post-date ?
+       if ($GLOBALS['meta']['post_dates'] == 'non'
+         AND isset($GLOBALS['meta']['date_prochain_postdate'])
+         AND time() > $GLOBALS['meta']['date_prochain_postdate']) {
+               spip_log('Un article post-date invalide le cache');
+               include_spip('inc/rubriques');
+               calculer_prochain_postdate(true);
+       }
+
        if (defined('_VAR_NOCACHE') AND _VAR_NOCACHE) return -1;
        if (isset($GLOBALS['meta']['cache_inhib']) AND $_SERVER['REQUEST_TIME']<$GLOBALS['meta']['cache_inhib']) return -1;
        if (defined('_NO_CACHE')) return (_NO_CACHE==0 AND !isset($page['texte']))?1:_NO_CACHE;
@@ -129,17 +138,6 @@ function cache_valide(&$page, $date) {
                AND $date < $GLOBALS['meta']['derniere_modif'])
                        return 1;
 
-               // Apparition d'un nouvel article post-date ?
-               if ($GLOBALS['meta']['post_dates'] == 'non'
-               AND isset($GLOBALS['meta']['date_prochain_postdate'])
-               AND time() > $GLOBALS['meta']['date_prochain_postdate']) {
-                       spip_log('Un article post-date invalide le cache');
-                       include_spip('inc/rubriques');
-                       ecrire_meta('derniere_modif', time());
-                       calculer_prochain_postdate();
-                       return 1;
-               }
-
        }
 
        // Sinon comparer l'age du fichier a sa duree de cache