Changeset 5274 in subversion
- Timestamp:
- Sep 23, 2011 6:11:27 AM (20 months ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 5 edited
-
index.php (modified) (2 diffs)
-
program/include/rcube_shared.inc (modified) (14 diffs)
-
program/steps/addressbook/export.inc (modified) (1 diff)
-
program/steps/mail/get.inc (modified) (1 diff)
-
program/steps/mail/show.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/index.php
r5124 r5274 33 33 // init application, start session, init output class, etc. 34 34 $RCMAIL = rcmail::get_instance(); 35 36 // Make the whole PHP output non-cacheable (#1487797) 37 send_nocacheing_headers(); 35 38 36 39 // turn on output buffering … … 178 181 ); 179 182 } 180 183 181 184 if ($session_error || $_REQUEST['_err'] == 'session') 182 185 $OUTPUT->show_message('sessionerror', 'error', null, true, -1); -
trunk/roundcubemail/program/include/rcube_shared.inc
r4710 r5274 23 23 /** 24 24 * Roundcube shared functions 25 * 25 * 26 26 * @package Core 27 27 */ … … 71 71 72 72 /** 73 * Check request for If-Modified-Since and send an according response.74 * This will terminate the current script if headers match the given values75 *76 * @param int Modified date as unix timestamp77 * @param string Etag value for caching78 */79 function send_modified_header($mdate, $etag=null, $skip_check=false)80 {81 if (headers_sent())82 return;83 84 $iscached = false;85 $etag = $etag ? "\"$etag\"" : null;86 87 if (!$skip_check)88 {89 if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] && strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $mdate)90 $iscached = true;91 92 if ($etag)93 $iscached = ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag);94 }95 96 if ($iscached)97 header("HTTP/1.x 304 Not Modified");98 else99 header("Last-Modified: ".gmdate("D, d M Y H:i:s", $mdate)." GMT");100 101 header("Cache-Control: private, must-revalidate, max-age=0");102 header("Expires: ");103 header("Pragma: ");104 105 if ($etag)106 header("Etag: $etag");107 108 if ($iscached)109 {110 ob_end_clean();111 exit;112 }113 }114 115 116 /**117 73 * Similar function as in_array() but case-insensitive 118 74 * … … 127 83 if ($needle===mb_strtolower($value)) 128 84 return true; 129 85 130 86 return false; 131 87 } … … 219 175 $host_url = $base_url; 220 176 $abs_path = $path; 221 177 222 178 // check if path is an absolute URL 223 179 if (preg_match('/^[fhtps]+:\/\//', $path)) … … 326 282 327 283 return $hdrs[$key]; 328 }284 } 329 285 330 286 … … 345 301 return preg_replace('/\/$/', '', $str); 346 302 } 347 303 348 304 349 305 /** … … 375 331 */ 376 332 function get_offset_time($offset_str, $factor=1) 377 {333 { 378 334 if (preg_match('/^([0-9]+)\s*([smhdw])/i', $offset_str, $regs)) 379 335 { … … 386 342 $unit = 's'; 387 343 } 388 344 389 345 $ts = mktime(); 390 346 switch ($unit) … … 419 375 { 420 376 $length = mb_strlen($str); 421 377 422 378 if ($length > $maxlength) 423 379 { … … 433 389 return $str; 434 390 } 391 435 392 436 393 /** … … 548 505 return $input; 549 506 } 550 507 551 508 if (!is_string($input) || $input == '') 552 509 return $input; … … 570 527 '|\xF4[\x80-\x8F][\x80-\xBF][\x80-\xBF]'. // UTF8-4 571 528 ')$/'; 572 529 573 530 $seq = ''; 574 531 $out = ''; … … 641 598 } 642 599 } 643 600 644 601 $result[] = substr($string, $p); 645 602 return $result; … … 656 613 { 657 614 $keys = array(); 658 615 659 616 if (!empty($array)) 660 617 foreach ($array as $key => $child) { -
trunk/roundcubemail/program/steps/addressbook/export.inc
r5012 r5274 67 67 68 68 // send downlaod headers 69 send_nocacheing_headers();70 69 header('Content-Type: text/x-vcard; charset='.RCMAIL_CHARSET); 71 70 header('Content-Disposition: attachment; filename="rcube_contacts.vcf"'); -
trunk/roundcubemail/program/steps/mail/get.inc
r5143 r5274 64 64 $MESSAGE = new rcube_message(get_input_value('_uid', RCUBE_INPUT_GET)); 65 65 } 66 67 send_nocacheing_headers();68 66 69 67 // show part page -
trunk/roundcubemail/program/steps/mail/show.inc
r5233 r5274 31 31 } 32 32 33 send_nocacheing_headers();34 35 33 $mbox_name = $IMAP->get_mailbox_name(); 36 34
Note: See TracChangeset
for help on using the changeset viewer.
