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