components/php-5_2/php-sapi/patches/50_php_zlib.patch
branchs11-update
changeset 3797 b4272e89e9f2
equal deleted inserted replaced
3796:82cd21906ac2 3797:b4272e89e9f2
       
     1 Patch origin: upstream
       
     2 Patch status: Part 1: unclear; patch attached to bug
       
     3 Patch status: Part 2: more generic fix already in php 5.3
       
     4 
       
     5 https://bugs.php.net/bug.php?id=53829
       
     6 http://git.php.net/?p=php-src.git;a=commitdiff;h=a8948d08083bf59d437ac21abe5929f5668f41d7
       
     7 
       
     8 --- php-5.2.17/ext/zlib/zlib.c
       
     9 +++ php-5.2.17/ext/zlib/zlib.c
       
    10 @@ -58,6 +58,18 @@
       
    11  # endif
       
    12  #endif
       
    13  
       
    14 +/*
       
    15 + * zlib include files can define the following preprocessor defines which rename
       
    16 + * the corresponding PHP functions to gzopen64, gzseek64 and gztell64 and thereby
       
    17 + * breaking some software, most notably PEAR's Archive_Tar, which halts execution
       
    18 + * without error message on gzip compressed archivesa.
       
    19 + *
       
    20 + * This only seems to happen on 32bit systems with large file support.
       
    21 + */
       
    22 +#undef gzopen
       
    23 +#undef gzseek
       
    24 +#undef gztell
       
    25 +
       
    26  #if defined(HAVE_UNISTD_H) && defined(PHP_WIN32)
       
    27  # undef HAVE_UNISTD_H
       
    28  #endif
       
    29 --- php-5.2.17/ext/zlib/tests/gzgetc_basic.phpt
       
    30 +++ php-5.2.17/ext/zlib/tests/gzgetc_basic.phpt
       
    31 @@ -14,16 +14,17 @@
       
    32  
       
    33  $f = dirname(__FILE__)."/004.txt.gz";
       
    34  $h = gzopen($f, 'r');
       
    35 +if ($h) {
       
    36 +	$count = 0;
       
    37 +	while (($c = fgetc( $h )) !== false) {
       
    38 +	   $count++;
       
    39 +	   echo $c;
       
    40 +	}
       
    41  
       
    42 -$count = 0;
       
    43 -while (gzeof($h) === false) {
       
    44 -   $count++;
       
    45 -   echo fgetc( $h );
       
    46 +	echo "\ncharacters counted=$count\n";
       
    47 +	gzclose($h);
       
    48  }
       
    49  
       
    50 -echo "\ncharacters counted=$count\n";
       
    51 -gzclose($h);
       
    52 -
       
    53  ?>
       
    54  ===DONE===
       
    55  --EXPECT--