json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-9f864a903a308b30517f05d50c3d4492.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-a354d4299731b33e847e6eb5329b1a7e.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-a3f7f18b58640a626fd1dfafe4b5ba63.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-a46e2cdf66e3645fd11b123961dc9b40.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-a55d428c84e9a3179fe241ec600a0f03.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-a65b4ddf263e8c410e9bcbfd6e6d72e4.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-a8b73b087444470c8f4396b7142908f6.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-abb904b047b7be3be9d638e2c6144691.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-ae1c49c8c0597593a9c36e106a04bd60.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-aed4ce3ede1d44a8fecfe0edfbf8421c.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-af52ab8cb2e7713cf3037751dd593965.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-afbede9cda22f594a80ae8b178e0e98c.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-afd1e270efc2e8283acfd50ccab18d2b.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b007baff76144318d6c33cd26f4bfdb9.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b0a592b6fe83588c5d1b8ed6850b6a74.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b155b7bf28890099b74a84417cbaafe9.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b1bb8fbd24d68a9c893faf1a6f7b493b.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b1bcbab1d6a7ca6b0433d67776f347f1.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b239ff15197a133498a4b025f002dee5.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b2e956ee35340f6e47f27f8a54309ac3.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b31f51fa0bb40ceb060aaa9f77ca1771.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b3f83696a2cb49f571043ce14a384a76.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b4bf1e55ca6145f38f1b2f104201da21.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b826befd7acca93e8e4c12b7cd2fc7f1.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-b9bf1ca91d393a30e2461ef709f8fa10.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-ba8d2fb7c85928310d4f3a907b7d9bdd.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-bb0f027faa1257de4b730158475093de.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-bb5c5935ec0d64e8880b1c7794470460.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-bc1f4f7aec77a0a6dd229cc910f601f1.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-bc9c3f9eda462d6d9968c1dca51e7c62.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-bcb06ab6e8931a862dec9c07c66df45b.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c06829f63f73ae430c10ae700fb1eb6d.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c0faba84c7842505f8893c2c327a9f78.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c13acd243559529a685813d9871026a1.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c1bc39bcdee2da3c0b62bcd5372120f4.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c22945301f466e2d78d6e80404a22664.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c2435bc8dfd186b147aba658416d115e.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c257c024e3db4e010644d2c7be3c7090.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c2d9a34cf502bd5b5a80ca646a1420b3.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c5702ace609dd30ccabd4c999de43096.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c608fe5deda8db7667c8431ca6fd222a.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c6c5331d3afe1391f2ca83e991ccc086.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c70671124b0e00661f88fe1616dfc9f0.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c8cbe8ef95155db152b270d441fc8528.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c8ddf2164475a213274d06873bfbb73a.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-c93706e596cbd46fb0d621f4fe3efb80.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-ca3cd4394cb082bde7555ebd3bb5f143.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-cb71ce5ddcc7c808172e80a0dc9833d5.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-cc16013df9d4b0a0ba45297b90b06f20.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-ccc500b0b722a0c96712f1634cbb7289.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-cd9fc1d9fc46b55bb32d0fd471457690.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-ce3f8f2f3e0f3c58f8aea5b7aa5cc6f4.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d05ee634b22d05f0055b724443f05a68.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d0d05e0dda872b433f260969b4d53b30.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d0fa7cd1cd624e53cc7b4fde655c20af.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d2b4400b6de0e69404e0f7f61d16bc55.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d3e57c518feb58ab8ea4f9d2d8e66160.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d4c505e96199e8c818fc6d24151d9c4a.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d5ea33028f13b50f40bbcce807e37fc0.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d6f4faa954a31ef3d5b74c2dfe13f141.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d7bbe90eb59636eb8a6f31c7979ab6f5.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-d80020dab74131d7f0c108526c0fbebe.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-da92a9b2d4c08762c60d7c4c569eb5db.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-de12a4697822740a2fbaeb47c5062af1.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-deed2aed3392b43c83c7cea296b154af.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-df51042cba56a4e9fcac0e5db643906a.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-dfb09f9953676bbc1de4eb2b9f232c6d.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-dfbfe3d556f60ebbd62c2b5c8e0fa466.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e03ec35386c2705c11cebd6288b33cf8.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e0bde0ac58f55fc6b1426844e6697db3.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e0f9c7d89b1b130a9023c5c2fde2815e.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e41c58d5fb39f750efcbf65a2b55460b.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e44671e4528b0da3a0fd6feaf8abadca.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e4fbc8d7fc7a16bd8cf2e0522a199de0.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e690486b33a7bb1944a37f6e734d734f.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e80539b9960e930bf0dcd334d99eb128.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e885442559cb44e8b827f0e0ca0a14c9.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-e88dc35c02f6fa832e90fac5a122323c.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-ea6fb371f81c4d3584bbc795fa4ac09c.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-ed9b16000a6d37c51bf23c61f4df878e.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-ef5798395d7601ab6fea0f1efd60f40a.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f31b0aa0c71dd74b7103120610ca6253.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f34924aeff974b0bdbfac124c23fbfe3.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f39008456fd28b2f79cdb0964ff294e1.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f3f1cc4f5811d4bf8a04a58feca06858.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f56e66fd08c07abc78cd844f7e83af8c.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f60049653c419cfb1e3dc8876e7a8bdb.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f686a272add740773cdcb730afdb5454.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f976da155dfdd080588c50ccda5af747.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-f9c56a0cbb6710505047e6c835953c82.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-fb2ef023bdd44902b5a309e25e0b7792.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-fc1fe56fadfdeeb25d1bc441581d92b6.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-fc4895b6508f32c16c4d8bc69f8162b6.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-fd20fc8ea1484781160e8ea0d229d5e9.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-fffdec5db595ec0ca7d043c87bae79b8.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th-wc-admin-app.json d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th.mo d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años woocommerce-th.po d01d7cf85d first commit %!s(int64=4) %!d(string=hace) años tum/whitesports - Gogs: Simplico Git Service

Nenhuma Descrição

gzdecode.php 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <?php
  2. /**
  3. * SimplePie
  4. *
  5. * A PHP-Based RSS and Atom Feed Framework.
  6. * Takes the hard work out of managing a complete RSS/Atom solution.
  7. *
  8. * Copyright (c) 2004-2016, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors
  9. * All rights reserved.
  10. *
  11. * Redistribution and use in source and binary forms, with or without modification, are
  12. * permitted provided that the following conditions are met:
  13. *
  14. * * Redistributions of source code must retain the above copyright notice, this list of
  15. * conditions and the following disclaimer.
  16. *
  17. * * Redistributions in binary form must reproduce the above copyright notice, this list
  18. * of conditions and the following disclaimer in the documentation and/or other materials
  19. * provided with the distribution.
  20. *
  21. * * Neither the name of the SimplePie Team nor the names of its contributors may be used
  22. * to endorse or promote products derived from this software without specific prior
  23. * written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
  26. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  27. * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
  28. * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  29. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  31. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  32. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. * POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. * @package SimplePie
  36. * @copyright 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
  37. * @author Ryan Parman
  38. * @author Sam Sneddon
  39. * @author Ryan McCue
  40. * @link http://simplepie.org/ SimplePie
  41. * @license http://www.opensource.org/licenses/bsd-license.php BSD License
  42. */
  43. /**
  44. * Decode 'gzip' encoded HTTP data
  45. *
  46. * @package SimplePie
  47. * @subpackage HTTP
  48. * @link http://www.gzip.org/format.txt
  49. */
  50. class SimplePie_gzdecode
  51. {
  52. /**
  53. * Compressed data
  54. *
  55. * @access private
  56. * @var string
  57. * @see gzdecode::$data
  58. */
  59. var $compressed_data;
  60. /**
  61. * Size of compressed data
  62. *
  63. * @access private
  64. * @var int
  65. */
  66. var $compressed_size;
  67. /**
  68. * Minimum size of a valid gzip string
  69. *
  70. * @access private
  71. * @var int
  72. */
  73. var $min_compressed_size = 18;
  74. /**
  75. * Current position of pointer
  76. *
  77. * @access private
  78. * @var int
  79. */
  80. var $position = 0;
  81. /**
  82. * Flags (FLG)
  83. *
  84. * @access private
  85. * @var int
  86. */
  87. var $flags;
  88. /**
  89. * Uncompressed data
  90. *
  91. * @access public
  92. * @see gzdecode::$compressed_data
  93. * @var string
  94. */
  95. var $data;
  96. /**
  97. * Modified time
  98. *
  99. * @access public
  100. * @var int
  101. */
  102. var $MTIME;
  103. /**
  104. * Extra Flags
  105. *
  106. * @access public
  107. * @var int
  108. */
  109. var $XFL;
  110. /**
  111. * Operating System
  112. *
  113. * @access public
  114. * @var int
  115. */
  116. var $OS;
  117. /**
  118. * Subfield ID 1
  119. *
  120. * @access public
  121. * @see gzdecode::$extra_field
  122. * @see gzdecode::$SI2
  123. * @var string
  124. */
  125. var $SI1;
  126. /**
  127. * Subfield ID 2
  128. *
  129. * @access public
  130. * @see gzdecode::$extra_field
  131. * @see gzdecode::$SI1
  132. * @var string
  133. */
  134. var $SI2;
  135. /**
  136. * Extra field content
  137. *
  138. * @access public
  139. * @see gzdecode::$SI1
  140. * @see gzdecode::$SI2
  141. * @var string
  142. */
  143. var $extra_field;
  144. /**
  145. * Original filename
  146. *
  147. * @access public
  148. * @var string
  149. */
  150. var $filename;
  151. /**
  152. * Human readable comment
  153. *
  154. * @access public
  155. * @var string
  156. */
  157. var $comment;
  158. /**
  159. * Don't allow anything to be set
  160. *
  161. * @param string $name
  162. * @param mixed $value
  163. */
  164. public function __set($name, $value)
  165. {
  166. trigger_error("Cannot write property $name", E_USER_ERROR);
  167. }
  168. /**
  169. * Set the compressed string and related properties
  170. *
  171. * @param string $data
  172. */
  173. public function __construct($data)
  174. {
  175. $this->compressed_data = $data;
  176. $this->compressed_size = strlen($data);
  177. }
  178. /**
  179. * Decode the GZIP stream
  180. *
  181. * @return bool Successfulness
  182. */
  183. public function parse()
  184. {
  185. if ($this->compressed_size >= $this->min_compressed_size)
  186. {
  187. // Check ID1, ID2, and CM
  188. if (substr($this->compressed_data, 0, 3) !== "\x1F\x8B\x08")
  189. {
  190. return false;
  191. }
  192. // Get the FLG (FLaGs)
  193. $this->flags = ord($this->compressed_data[3]);
  194. // FLG bits above (1 << 4) are reserved
  195. if ($this->flags > 0x1F)
  196. {
  197. return false;
  198. }
  199. // Advance the pointer after the above
  200. $this->position += 4;
  201. // MTIME
  202. $mtime = substr($this->compressed_data, $this->position, 4);
  203. // Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness
  204. if (current(unpack('S', "\x00\x01")) === 1)
  205. {
  206. $mtime = strrev($mtime);
  207. }
  208. $this->MTIME = current(unpack('l', $mtime));
  209. $this->position += 4;
  210. // Get the XFL (eXtra FLags)
  211. $this->XFL = ord($this->compressed_data[$this->position++]);
  212. // Get the OS (Operating System)
  213. $this->OS = ord($this->compressed_data[$this->position++]);
  214. // Parse the FEXTRA
  215. if ($this->flags & 4)
  216. {
  217. // Read subfield IDs
  218. $this->SI1 = $this->compressed_data[$this->position++];
  219. $this->SI2 = $this->compressed_data[$this->position++];
  220. // SI2 set to zero is reserved for future use
  221. if ($this->SI2 === "\x00")
  222. {
  223. return false;
  224. }
  225. // Get the length of the extra field
  226. $len = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
  227. $this->position += 2;
  228. // Check the length of the string is still valid
  229. $this->min_compressed_size += $len + 4;
  230. if ($this->compressed_size >= $this->min_compressed_size)
  231. {
  232. // Set the extra field to the given data
  233. $this->extra_field = substr($this->compressed_data, $this->position, $len);
  234. $this->position += $len;
  235. }
  236. else
  237. {
  238. return false;
  239. }
  240. }
  241. // Parse the FNAME
  242. if ($this->flags & 8)
  243. {
  244. // Get the length of the filename
  245. $len = strcspn($this->compressed_data, "\x00", $this->position);
  246. // Check the length of the string is still valid
  247. $this->min_compressed_size += $len + 1;
  248. if ($this->compressed_size >= $this->min_compressed_size)
  249. {
  250. // Set the original filename to the given string
  251. $this->filename = substr($this->compressed_data, $this->position, $len);
  252. $this->position += $len + 1;
  253. }
  254. else
  255. {
  256. return false;
  257. }
  258. }
  259. // Parse the FCOMMENT
  260. if ($this->flags & 16)
  261. {
  262. // Get the length of the comment
  263. $len = strcspn($this->compressed_data, "\x00", $this->position);
  264. // Check the length of the string is still valid
  265. $this->min_compressed_size += $len + 1;
  266. if ($this->compressed_size >= $this->min_compressed_size)
  267. {
  268. // Set the original comment to the given string
  269. $this->comment = substr($this->compressed_data, $this->position, $len);
  270. $this->position += $len + 1;
  271. }
  272. else
  273. {
  274. return false;
  275. }
  276. }
  277. // Parse the FHCRC
  278. if ($this->flags & 2)
  279. {
  280. // Check the length of the string is still valid
  281. $this->min_compressed_size += $len + 2;
  282. if ($this->compressed_size >= $this->min_compressed_size)
  283. {
  284. // Read the CRC
  285. $crc = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
  286. // Check the CRC matches
  287. if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc)
  288. {
  289. $this->position += 2;
  290. }
  291. else
  292. {
  293. return false;
  294. }
  295. }
  296. else
  297. {
  298. return false;
  299. }
  300. }
  301. // Decompress the actual data
  302. if (($this->data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false)
  303. {
  304. return false;
  305. }
  306. $this->position = $this->compressed_size - 8;
  307. // Check CRC of data
  308. $crc = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
  309. $this->position += 4;
  310. /*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc))
  311. {
  312. return false;
  313. }*/
  314. // Check ISIZE of data
  315. $isize = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
  316. $this->position += 4;
  317. if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize))
  318. {
  319. return false;
  320. }
  321. // Wow, against all odds, we've actually got a valid gzip string
  322. return true;
  323. }
  324. return false;
  325. }
  326. }