Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/requeststream/AphrontRequestStream.php
| Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | public static function supportsGzip() { | ||||
| $has_zlib = false; | $has_zlib = false; | ||||
| // NOTE: At least locally, this returns "zlib.*", which is not terribly | // NOTE: At least locally, this returns "zlib.*", which is not terribly | ||||
| // reassuring. We care about "zlib.inflate". | // reassuring. We care about "zlib.inflate". | ||||
| $filters = stream_get_filters(); | $filters = stream_get_filters(); | ||||
| foreach ($filters as $filter) { | foreach ($filters as $filter) { | ||||
| if (preg_match('/^zlib\\./', $filter)) { | if (!strncasecmp($filter, 'zlib.', strlen('zlib.'))) { | ||||
| $has_zlib = true; | $has_zlib = true; | ||||
| break; | |||||
| } | } | ||||
| } | } | ||||
| return $has_zlib; | return $has_zlib; | ||||
| } | } | ||||
| } | } | ||||