| @@ 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) . '"'; |
|
| @@ 1600-1611 (lines=12) @@ | ||
| 1597 | } |
|
| 1598 | ||
| 1599 | // If it hasn't been modified since the last time this attachment was retrieved, there's no need to display it again. |
|
| 1600 | if (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) |
|
| 1601 | { |
|
| 1602 | list($modified_since) = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE']); |
|
| 1603 | if (strtotime($modified_since) >= filemtime($filename)) |
|
| 1604 | { |
|
| 1605 | ob_end_clean(); |
|
| 1606 | ||
| 1607 | // Answer the question - no, it hasn't been modified ;). |
|
| 1608 | header('HTTP/1.1 304 Not Modified'); |
|
| 1609 | exit; |
|
| 1610 | } |
|
| 1611 | } |
|
| 1612 | ||
| 1613 | // Check whether the ETag was sent back, and cache based on that... |
|
| 1614 | $eTag = '"' . substr($_REQUEST['attach'] . $real_filename . filemtime($filename), 0, 64) . '"'; |
|