Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1168,15 +1168,17 @@ |
1169 | 1169 | */ |
1170 | 1170 | function wfClientAcceptsGzip() { |
1171 | 1171 | global $wgUseGzip; |
1172 | | - # FIXME: we may want to blacklist some broken browsers |
1173 | | - $m = array(); |
1174 | | - if( preg_match( |
1175 | | - '/\bgzip(?:;(q)=([0-9]+(?:\.[0-9]+)))?\b/', |
1176 | | - $_SERVER['HTTP_ACCEPT_ENCODING'], |
1177 | | - $m ) ) { |
1178 | | - if( isset( $m[2] ) && ( $m[1] == 'q' ) && ( $m[2] == 0 ) ) return false; |
1179 | | - wfDebug( " accepts gzip\n" ); |
1180 | | - return true; |
| 1172 | + if( $wgUseGzip ) { |
| 1173 | + # FIXME: we may want to blacklist some broken browsers |
| 1174 | + $m = array(); |
| 1175 | + if( preg_match( |
| 1176 | + '/\bgzip(?:;(q)=([0-9]+(?:\.[0-9]+)))?\b/', |
| 1177 | + $_SERVER['HTTP_ACCEPT_ENCODING'], |
| 1178 | + $m ) ) { |
| 1179 | + if( isset( $m[2] ) && ( $m[1] == 'q' ) && ( $m[2] == 0 ) ) return false; |
| 1180 | + wfDebug( " accepts gzip\n" ); |
| 1181 | + return true; |
| 1182 | + } |
1181 | 1183 | } |
1182 | 1184 | return false; |
1183 | 1185 | } |
Index: trunk/phase3/includes/OutputHandler.php |
— | — | @@ -74,9 +74,12 @@ |
75 | 75 | return $s; |
76 | 76 | } |
77 | 77 | |
78 | | - if( wfClientAcceptsGzip() ) { |
79 | | - header( 'Content-Encoding: gzip' ); |
80 | | - $s = gzencode( $s, 6 ); |
| 78 | + if( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) { |
| 79 | + $tokens = preg_split( '/[,; ]/', $_SERVER['HTTP_ACCEPT_ENCODING'] ); |
| 80 | + if ( in_array( 'gzip', $tokens ) ) { |
| 81 | + header( 'Content-Encoding: gzip' ); |
| 82 | + $s = gzencode( $s, 6 ); |
| 83 | + } |
81 | 84 | } |
82 | 85 | |
83 | 86 | // Set vary header if it hasn't been set already |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -19,7 +19,6 @@ |
20 | 20 | it from source control: http://www.mediawiki.org/wiki/Download_from_SVN |
21 | 21 | |
22 | 22 | === Configuration changes in 1.16 === |
23 | | - |
24 | 23 | * (bug 18222) $wgMinimalPasswordLength default is now 1 |
25 | 24 | * $wgSessionHandler can be used to configure session.save_handler |
26 | 25 | * $wgLocalFileRepo/$wgForeignFileRepos now have a 'fileMode' parameter to |
— | — | @@ -82,12 +81,12 @@ |
83 | 82 | similarly to the category namespace. |
84 | 83 | * $wgEnableSorbs renamed to $wgDnsBlacklistUrls ($wgEnableSorbs kept for |
85 | 84 | backward compatibility) |
86 | | -* $wgUploadNavigationUrl now also affects images inline images that do not |
87 | | - exist. In that case the URL will get (?|&)wpDestFile=<filename> appended to |
| 85 | +* $wgUploadNavigationUrl now also affects images inline images that do not |
| 86 | + exist. In that case the URL will get (?|&)wpDestFile=<filename> appended to |
88 | 87 | it as appropriate. |
89 | 88 | * If $wgLocaltimezone is null, use the server's timezone as the default for |
90 | 89 | signatures. This was always the behaviour documented in DefaultSettings.php |
91 | | - but has not been the actual behaviour for some time: instead, UTC was used |
| 90 | + but has not been the actual behaviour for some time: instead, UTC was used |
92 | 91 | by default. |
93 | 92 | |
94 | 93 | |
— | — | @@ -660,10 +659,10 @@ |
661 | 660 | only displayed to the users that have "editinterface" right |
662 | 661 | * (bug 21740) Attempting to protect a page that doesn't exist (salting) returns |
663 | 662 | "unknown error" |
664 | | -* (bug 18762) both redirects and links get fixed one after another if |
| 663 | +* (bug 18762) both redirects and links get fixed one after another if |
665 | 664 | redirects-only switch is not present |
666 | 665 | * (bug 20159) thumbnails rerendered if older that $wgThumbnailEpoch |
667 | | -* Fixed a bug which in some situations causes the job queue to grow forever, |
| 666 | +* Fixed a bug which in some situations causes the job queue to grow forever, |
668 | 667 | due to an infinite loop of job requeues. |
669 | 668 | * (bug 21523) File that can have multiple pages (djvu, pdf, ...) no longer have |
670 | 669 | the page selector when they have only one page |
— | — | @@ -694,8 +693,6 @@ |
695 | 694 | * (bug 2658) Don't attempt to set the TZ environment variable. |
696 | 695 | * (bug 9794) User rights log entries for foreign user now links to the foreign |
697 | 696 | user's page if possible |
698 | | -* (bug 22034) Use wfClientAcceptsGzip() in wfGzipHandler instead of |
699 | | - reimplementing it. |
700 | 697 | |
701 | 698 | == API changes in 1.16 == |
702 | 699 | |
— | — | @@ -766,8 +763,8 @@ |
767 | 764 | * (bug 21441) meta=userinfo&uiprop=options no longer returns default options |
768 | 765 | for logged-in users under certain circumstances |
769 | 766 | * (bug 21945) Add chomp control in YAML |
770 | | -* Expand the thumburl to an absolute url to make it consistent with url and |
771 | | - descriptionurl |
| 767 | +* Expand the thumburl to an absolute url to make it consistent with url and |
| 768 | + descriptionurl |
772 | 769 | * (bug 20233) ApiLogin::execute() doesn't handle LoginForm :: RESET_PASS |
773 | 770 | |
774 | 771 | === Languages updated in 1.16 === |