Bug #53230 [Com]: extracting file go to infinite loop

2011-02-21 Thread tbrasta at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53230edit=1

 ID: 53230
 Comment by: tbrasta at gmail dot com
 Reported by:vincent dot gibault at gmail dot com
 Summary:extracting file go to infinite loop
 Status: Open
 Type:   Bug
 Package:Zip Related
 Operating System:   archlinux x86_64
 PHP Version:5.3.3
 Block user comment: N
 Private report: N

 New Comment:

Your file is corrupted. It contains invalid crc, compressed and
uncompressed data lenghts of archived file.

It is libzip related bug. More details here
http://nih.at/listarchive/libzip-discuss/msg00074.html.


Previous Comments:

[2010-11-03 21:25:32] vincent dot gibault at gmail dot com

Hello,



here is the link: http://www.corrida-noel-issy.com/bug.zip


[2010-11-02 22:37:59] paj...@php.net

Please provide a link to the zip you are using for this bug.


[2010-11-02 22:06:20] vincent dot gibault at gmail dot com

Description:

The files joined contained: the script example.php and the archive
example.zip.



I can unzip the example.zip with the following commandlines:

unzip example.php

iconv -f UTF16 -t UTF8 data

( show the data xml values ).



But the test script failed to unzip the compressed file.

Test script:
---
$zip = new ZipArchive ();

$zip-open( 'example.zip' );

$f = $zip-getStream ('data');

 while (!feof($f)) {

  echo fgets($f);

} 

fclose($f);

$zip-close();

Expected result:

not to go in infinite loop.

Actual result:
--
don't work. Please send me an email to have the example.zip






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53230edit=1


Bug #53724 [Com]: array_diff like methods compares false as identity and true as equal

2011-02-20 Thread tbrasta at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53724edit=1

 ID: 53724
 Comment by: tbrasta at gmail dot com
 Reported by:lukas dot starecek at centrum dot cz
 Summary:array_diff like methods compares false as identity
 and true as equal
 Status: Open
 Type:   Bug
 Package:Arrays related
 Operating System:   Irrelevant
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

This is not a bug. The function is operating exactly as stated in the
documentation, i.e. casted to string values are compared. Since (string)
0 = 0, (string) false =  and (string) 0 = 0 but 0 !== , you
get the result as it should be.


Previous Comments:

[2011-01-12 14:27:34] lukas dot starecek at centrum dot cz

A little mistake, '' behaves as same with false, so problem is only in
comparing 0 and '0' (and maybee some other variables I did not used).


[2011-01-12 14:16:39] lukas dot starecek at centrum dot cz

Description:

array_diff functions compares boolean false as identity (operator ===)
and boolean true as equal (operator ==) so behaves inconsistently. It
should compare all values in same way and in my opinion it should
compare as equals (==) or have argument (or another mechanism) how to
set whether compare by equal or identity.



As example I use array_diff_assoc but I think it will probably behave
simmilary with another array realted functions (array_diff%,
array_intersect%). In expected result I suppose comparing as equal
(operator '==').



In example you can see, that array_diff_assoc behaves in such way that 0
or '0' or '' is not same as false, but 1 or '1' is same as true. So
false is compared like '===' and true is compared like '=='. Because 0
is same as '0' and 1 is same as '1' I suppose, that this problem is only
for boolean false value.



Test script:
---
$arr1 = array('a' = 0, 'b' = 1,'c' = '0',   'd' = '1',  'e'
= '','f' = false, 'g' = true, 'h' = 0,   'i' = 1);

$arr2 = array('a' = false, 'b' = true, 'c' = false, 'd' = true, 'e'
= false, 'f' = false, 'g' = true, 'h' = '0', 'i' = '1');



var_dump(array_diff_assoc($arr1, $arr2));

Expected result:

array(0) {

}



Actual result:
--
array(2) {

  [a]=

  int(0)

  [c]=

  string(1) 0

}








-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53724edit=1


#43870 [NEW]: mysql_query() return true on error using UPDATE

2008-01-16 Thread tbrasta at gmail dot com
From: tbrasta at gmail dot com
Operating system: Ubuntu 7.10
PHP version:  5.2.5
PHP Bug Type: MySQL related
Bug description:  mysql_query() return true on error using UPDATE

Description:

It doesn't matter if a $file variable contains valid file name or just a
string of no sense, in both cases mysql_query() returns 'true'. When the
valid file name is being used the load is successful.


Reproduce code:
---
mysql_query(INSERT INTO ssert(id, file) VALUES(NULL, ''), $link);
$id = mysql_insert_id($link);
$file = /no/such/file;
if(mysql_query(UPDATE ssert SET file=LOAD_FILE('$file') WHERE id=$id,
$link))
{
  echo 'Success';
}
else
{
  echo 'False';
}

Expected result:

Expected 'False' on file not loaded into the database since /no/such/file
does not exist.

Actual result:
--
mysql_query(UPDATE ssert SET file=LOAD_FILE('$file') WHERE id=$id,
$link) returns true although the file does not exist.

-- 
Edit bug report at http://bugs.php.net/?id=43870edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43870r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43870r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43870r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43870r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43870r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=43870r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=43870r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=43870r=needscript
Try newer version:http://bugs.php.net/fix.php?id=43870r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=43870r=support
Expected behavior:http://bugs.php.net/fix.php?id=43870r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=43870r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=43870r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43870r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43870r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43870r=dst
IIS Stability:http://bugs.php.net/fix.php?id=43870r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=43870r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43870r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=43870r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=43870r=mysqlcfg