| @@ 209-220 (lines=12) @@ | ||
| 206 | } |
|
| 207 | ||
| 208 | // If it hasn't been modified since the last time this attachment was retrieved, there's no need to display it again. |
|
| 209 | if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) |
|
| 210 | { |
|
| 211 | list($modified_since) = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE']); |
|
| 212 | if (strtotime($modified_since) >= filemtime($file['filePath'])) |
|
| 213 | { |
|
| 214 | ob_end_clean(); |
|
| 215 | ||
| 216 | // Answer the question - no, it hasn't been modified ;). |
|
| 217 | header('HTTP/1.1 304 Not Modified'); |
|
| 218 | exit; |
|
| 219 | } |
|
| 220 | } |
|
| 221 | ||
| 222 | // Check whether the ETag was sent back, and cache based on that... |
|
| 223 | $eTag = '"' . substr($_REQUEST['attach'] . $file['filePath'] . filemtime($file['filePath']), 0, 64) . '"'; |
|
| @@ 1630-1641 (lines=12) @@ | ||
| 1627 | } |
|
| 1628 | ||
| 1629 | // If it hasn't been modified since the last time this attachment was retrieved, there's no need to display it again. |
|
| 1630 | if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) |
|
| 1631 | { |
|
| 1632 | list($modified_since) = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE']); |
|
| 1633 | if (strtotime($modified_since) >= filemtime($filename)) |
|
| 1634 | { |
|
| 1635 | ob_end_clean(); |
|
| 1636 | ||
| 1637 | // Answer the question - no, it hasn't been modified ;). |
|
| 1638 | header('HTTP/1.1 304 Not Modified'); |
|
| 1639 | exit; |
|
| 1640 | } |
|
| 1641 | } |
|
| 1642 | ||
| 1643 | // Check whether the ETag was sent back, and cache based on that... |
|
| 1644 | $eTag = '"' . substr($_REQUEST['attach'] . $real_filename . filemtime($filename), 0, 64) . '"'; |
|