Changeset 1128
- Timestamp:
- 10/24/07 08:35:33 (1 year ago)
- Files:
-
- trunk/wp-content/blogs.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-content/blogs.php
r1044 r1128 3 3 require_once( dirname( dirname( __FILE__) ) . '/wp-config.php' ); // absolute includes are faster 4 4 5 if ( 6 $current_blog->archived == '1' || 7 $current_blog->spam == '1' || 8 $current_blog->deleted == '1' 9 ) { 10 header("HTTP/1.1 404 Not Found"); 5 if ( $current_blog->archived == '1' || $current_blog->spam == '1' || $current_blog->deleted == '1' ) { 6 header('HTTP/1.1 404 Not Found'); 11 7 die('404 — File not found.'); 12 8 } … … 56 52 $ext = false; 57 53 58 foreach ( $mimes as $ext_preg => $mime_match) {54 foreach ( (array)$mimes as $ext_preg => $mime_match ) { 59 55 $ext_preg = '!\.(' . $ext_preg . ')$!i'; 60 56 if ( preg_match($ext_preg, $filename, $ext_matches) ) { … … 70 66 71 67 72 $file = constant( "ABSPATH" ) . constant( "UPLOADS") . str_replace( '..', '', $_GET[ 'file' ] );68 $file = constant( 'ABSPATH' ) . constant( 'UPLOADS' ) . str_replace( '..', '', $_GET[ 'file' ] ); 73 69 if ( !is_file( $file ) ) { 74 header( "HTTP/1.1 404 Not Found");70 header('HTTP/1.1 404 Not Found'); 75 71 die('404 — File not found.'); 76 72 } 77 73 78 if( function_exists( "mime_content_type") ) {74 if( function_exists( 'mime_content_type' ) ) { 79 75 $mime[ 'type' ] = mime_content_type( $file ); 80 76 } else { … … 87 83 $mimetype = "image/$ext"; 88 84 } 89 header( 'Content-type: ' . $mimetype ); // always send this 85 @header( 'Content-type: ' . $mimetype ); // always send this 86 @header( 'Content-Length: ' . filesize( $file ) ); 90 87 91 $timestamp = filemtime( $file ); 92 93 $last_modified = gmdate('D, d M Y H:i:s', $timestamp); 88 $last_modified = gmdate('D, d M Y H:i:s', filemtime( $file )); 94 89 $etag = '"' . md5($last_modified) . '"'; 95 90 @header( "Last-Modified: $last_modified GMT" ); 96 91 @header( 'ETag: ' . $etag ); 97 98 $expire = gmdate('D, d M Y H:i:s', time() + 100000000); 99 @header( "Expires: $expire GMT" ); 92 @header( 'Expires: ' . gmdate('D, d M Y H:i:s', time() + 100000000) . ' GMT' ); 100 93 101 94 // Support for Conditional GET 102 if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); 103 else $client_etag = false; 95 if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) 96 $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); 97 else 98 $client_etag = false; 104 99 105 100 $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']);
