]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fix notice in action with caching
authorEvan Prodromou <evan@controlyourself.ca>
Thu, 26 Feb 2009 21:36:27 +0000 (13:36 -0800)
committerEvan Prodromou <evan@controlyourself.ca>
Thu, 26 Feb 2009 21:36:27 +0000 (13:36 -0800)
lib/action.php

index 455ebeff0beb4f3b9898b067243fec04d5ee87d4..f19a047cfbf507f933d1d23b6dfd89df3d81204b 100644 (file)
@@ -812,11 +812,12 @@ class Action extends HTMLOutputter // lawsuit
         }
         if ($lm) {
             header('Last-Modified: ' . date(DATE_RFC1123, $lm));
-            $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
-            if ($if_modified_since) {
+            if (array_key_exists('HTTP_IF_MODIFIED_SINCE', $_SERVER)) {
+                $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
                 $ims = strtotime($if_modified_since);
                 if ($lm <= $ims) {
-                    $if_none_match = $_SERVER['HTTP_IF_NONE_MATCH'];
+                    $if_none_match = (array_key_exists('HTTP_IF_NONE_MATCH', $_SERVER)) ?
+                      $_SERVER['HTTP_IF_NONE_MATCH'] : null;
                     if (!$if_none_match ||
                         !$etag ||
                         $this->_hasEtag($etag, $if_none_match)) {