[PHP-BUG] Bug #53888 [NEW]: ftruncate() does not work with user-defined stream wrappers

2011-01-30 Thread ivan dot enderlin at hoa-project dot net
From: 
Operating system: 
PHP version:  trunk-SVN-2011-01-31 (SVN)
Package:  Filesystem function related
Bug Type: Bug
Bug description:ftruncate() does not work with user-defined stream wrappers

Description:

Hey :-),



Seems like ftruncate() does not reconized an user-defined stream (with
stream wrapper) as a valid stream. When we use it, it raises the following
error: “Can't truncate this stream!”. All the related subject about
this error on the Web talks about stream wrappers. Thus, it's seem to be
the real problem.

Test script:
---
getStream())) {



$this->_stream = null;

$this->_streamName = null;

}



return;

}



public function stream_eof ( ) {



return feof($this->getStream());

}



public function stream_flush ( ) {



return fflush($this->getStream());

}



public function stream_lock ( $operation ) {



return flock($this->getStream(), $operation);

}



public function stream_open ( $path, $mode, $options, &$openedPath ) {



$p = self::realPath($path);



if(false === $p)

return false;



if(null === $this->context)

$openedPath = fopen(

$p,

$mode,

$options & STREAM_USE_PATH

);

else

$openedPath = fopen(

$p,

$mode,

$options & STREAM_USE_PATH,

$this->context

);



$this->_stream = $openedPath;

$this->_streamName = $p;



return true;

}



public function stream_read ( $count ) {



return fread($this->getStream(), $count);

}



public function stream_seek ( $offset, $whence = SEEK_SET ) {



return fseek($this->getStream(), $offset, $whence);

}



public function stream_stat ( ) {



return fstat($this->getStream());

}



public function stream_tell ( ) {



return ftell($this->getStream());

}



public function stream_write ( $data ) {



return fwrite($this->getStream(), $data);

}



public function dir_closedir ( ) {



if(true === $handle = @closedir($this->getStream())) {



$this->_stream = null;

$this->_streamName = null;

}



return $handle;

}



public function dir_opendir ( $path, $options ) {



$p  = self::realPath($path);

$handle = null;



if(null === $this->context)

$handle = @opendir($p);

else

$handle = @opendir($p, $this->context);



if(false === $handle)

return false;



$this->_stream = $handle;

$this->_streamName = $p;



return true;

}



public function dir_readdir ( ) {



return readdir($this->getStream());

}



public function dir_rewinddir ( ) {



return rewinddir($this->getStream());

}



public function mkdir ( $path, $mode, $options ) {



if(null === $this->context)

return mkdir(

self::realPath($path),

$mode,

$options | STREAM_MKDIR_RECURSIVE

);



return mkdir(

self::realPath($path),

$mode,

$options | STREAM_MKDIR_RECURSIVE,

$this->context

);

}



public function rename ( $from, $to ) {



if(null === $this->context)

return rename(self::realPath($from), self::realPath($to));



return rename(self::realPath($from), self::realPath($to),
$this->context);

}



public function rmdir ( $path, $options ) {



if(null === $this->context)

return rmdir(self::realPath($path));



return rmdir(self::realPath($path), $this->context);

}



public function unlink ( $path ) {



if(null === $this->context)

return unlink(self::realPath($path));



return unlink(self::realPath($path), $this->context);

}



public function url_stat ( $path, $flags ) {



if(false === $p = self::realPath($path))

if($flags & STREAM_URL_STAT_QUIET)

return array(); // Not sure…

else

return trigger_error(

'Path ' . $path . ' cannot be resolved.',

E_WARNING

);



if($flags & STREAM_URL_STAT_LINK)

return @lstat($p);



return @stat($p);

}



protected function getStream ( ) {



return $this->_stream;

}



protected function getStreamName ( ) {



return $this->_streamName;

}

}



stream_wrapper_register('bug', 'StreamWrapper');





var_dump($fd = fopen('bug://Test.txt', 'w+'));



var_dump(fwrite($fd,'Foobar1'

[PHP-BUG] Bug #53887 [NEW]: When array data is int value, array_intersect() speed VERY SLOW.

2011-01-30 Thread paulgao at yeah dot net
From: 
Operating system: irrelevant
PHP version:  Irrelevant
Package:  Arrays related
Bug Type: Bug
Bug description:When array data is int value, array_intersect() speed VERY SLOW.

Description:

When array data is int value, array_intersect() speed VERY SLOW.

Test script:
---
 array_intersect by intval: {$time}, result: " . count($result) .
"\r\n";



$data_a = rand_data(TRUE);

$data_b = rand_data(TRUE);



$time = microtime(TRUE);



$result = array_intersect($data_a, $data_b);



$time = microtime(TRUE) - $time;



echo " -> array_intersect by string: {$time}, result: " . count($result) .
"\r\n";



function rand_data($need_string)

{

mt_srand();



$result = array();



for ($i = 0; $i < 30; $i++)

{

if ($need_string === TRUE)

{

$result[] = (string)mt_rand();

}

else

{

$result[] = mt_rand();

}

}



return $result;

}



?>

Expected result:

almost same?

Actual result:
--
 -> array_intersect by intval: 10.661009073257, result: 47

 -> array_intersect by string: 1.3067090511322, result: 41

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53887&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53887&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53887&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53887&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53887&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53887&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53887&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53887&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53887&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=53887&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=53887&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=53887&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=53887&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=53887&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53887&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=53887&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=53887&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=53887&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=53887&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=53887&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=53887&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=53887&r=mysqlcfg



Bug #50660 [Com]: exif_read_data(): Illegal IFD offset (works fine with other exif readers)

2011-01-30 Thread mjk at emmjaykay dot org
Edit report at http://bugs.php.net/bug.php?id=50660&edit=1

 ID: 50660
 Comment by: mjk at emmjaykay dot org
 Reported by:skinny dot bravo at gmail dot com
 Summary:exif_read_data(): Illegal IFD offset (works fine
 with other exif readers)
 Status: Verified
 Type:   Bug
 Package:EXIF related
 Operating System:   Linux
 PHP Version:5.*, 6
 Block user comment: N
 Private report: N

 New Comment:

The issue stems from exif.c's exif_process_IFD_in_JPEG() function where
it calculates NextDirOffset. If this means what I think it does, for
EXIF_IFD and IFD_GPS, there is no next IFD and no further parsing should
take place. Right now, it parses into the string for the next entry
(2009...)



I am not sure if this is correct since I am no expert on EXIF.



The output of var_dump seems to be still in-correct, though. I do not
know if this is a separate issue or something I introduced with this
patch.


Previous Comments:

[2010-01-06 12:49:45] skinny dot bravo at gmail dot com

Sorry,



- php5.2-201001041530 produces the same result

+ php5.2-201001041530 produces the same result as 5.2.12 below


[2010-01-06 12:42:40] il...@php.net

If it works with php5.2-201001041530 it means that the issue has been 

resolved.


[2010-01-04 17:55:52] skinny dot bravo at gmail dot com

Description:

PHP fails reading GPS data from a given set of photos from Samsung SGH-

i900. The images are said to come from the camera without any edits.



Ex: 



http://o1.imgsrc.ru/v/vahmurka/3/16095163cDU.jpg

http://o1.imgsrc.ru/v/vahmurka/1/16095161rno.jpg



exiftool 8.00 has no problem reading this file. php5.2-201001041530 

produces 

the same result.

Reproduce code:
---
# php -r 'var_dump(read_exif_data("16095163cDU.jpg",NULL,TRUE));'

Expected result:

...

["SectionsFound"]=>

string(35) "ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS"

...

["GPS"]=>

  array(8) {

["GPSVersion"]=>

string(4) ""

["GPSLatitudeRef"]=>

string(1) "N"

["GPSLatitude"]=>

array(3) {

  [0]=>

  string(4) "43/1"

  [1]=>

  string(4) "16/1"

  [2]=>

  string(11) "75363/1"

}

["GPSLongitudeRef"]=>

string(1) "E"

["GPSLongitude"]=>

array(3) {

  [0]=>

  string(4) "77/1"

  [1]=>

  string(4) "21/1"

  [2]=>

  string(11) "140249/2629"

}

["GPSAltitudeRef"]=>

string(1) ""

["GPSAltitude"]=>

string(6) "1603/1"

["GPSMapDatum"]=>

string(6) "WGS-84"

  }



these results are taken after fixing image with exiftool: 

# exiftool -all= -tagsfromfile @ -all:all -unsafe 16095163cDU.jpg



Actual result:
--
Warning: read_exif_data(16095163cDU.jpg): Illegal IFD offset in 

Command line code on line 1

array(4) {

  ["FILE"]=>

  array(6) {

["FileName"]=>

string(15) "16095163cDU.jpg"

["FileDateTime"]=>

int(1259257839)

["FileSize"]=>

int(938692)

["FileType"]=>

int(2)

["MimeType"]=>

string(10) "image/jpeg"

["SectionsFound"]=>

string(19) "ANY_TAG, IFD0, EXIF"

  }






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


Bug #53885 [Opn->Csd]: ZipArchive segfault with FL_UNCHANGED on empty archive

2011-01-30 Thread stas
Edit report at http://bugs.php.net/bug.php?id=53885&edit=1

 ID: 53885
 Updated by: s...@php.net
 Reported by:s...@php.net
 Summary:ZipArchive segfault with FL_UNCHANGED on empty
 archive
-Status: Open
+Status: Closed
 Type:   Bug
 Package:Zlib related
 Operating System:   *
 PHP Version:5.3SVN-2011-01-30 (SVN)
-Assigned To:
+Assigned To:stas
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2011-01-30 23:28:59] s...@php.net

Automatic comment from SVN on behalf of stas
Revision: http://svn.php.net/viewvc/?view=revision&revision=307867
Log: fix bug 53885 (ZipArchive segfault with FL_UNCHANGED on empty
archive)


[2011-01-30 23:15:51] s...@php.net

Description:

>From Maksymilian Arciemowicz:





PoC1:

php -r '$nx=new

ZipArchive();$nx->open("/dev/null");$nx-

>locateName("a",ZIPARCHIVE::FL_UNCHANGED);'



PoC2:

php -r '$nx=new

ZipArchive();$nx->open("empty.zip");$nx->statName("a",ZIPARCHIVE::FL_UNCHANGED);'





Segfault in _zip_name_locate.







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


[PHP-BUG] Bug #53885 [NEW]: ZipArchive segfault with FL_UNCHANGED on empty archive

2011-01-30 Thread s...@php.net
From: stas
Operating system: *
PHP version:  5.3SVN-2011-01-30 (SVN)
Package:  Zlib related
Bug Type: Bug
Bug description:ZipArchive segfault with FL_UNCHANGED on empty archive

Description:

>From Maksymilian Arciemowicz:





PoC1:

php -r '$nx=new

ZipArchive();$nx->open("/dev/null");$nx-

>locateName("a",ZIPARCHIVE::FL_UNCHANGED);'



PoC2:

php -r '$nx=new

ZipArchive();$nx->open("empty.zip");$nx->statName("a",ZIPARCHIVE::FL_UNCHANGED);'





Segfault in _zip_name_locate.


-- 
Edit bug report at http://bugs.php.net/bug.php?id=53885&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53885&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53885&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53885&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53885&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53885&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53885&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53885&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53885&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=53885&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=53885&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=53885&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=53885&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=53885&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53885&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=53885&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=53885&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=53885&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=53885&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=53885&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=53885&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=53885&r=mysqlcfg



Bug #53880 [Opn]: date_diff returns wrong results

2011-01-30 Thread an0nym at narod dot ru
Edit report at http://bugs.php.net/bug.php?id=53880&edit=1

 ID: 53880
 User updated by:an0nym at narod dot ru
 Reported by:an0nym at narod dot ru
 Summary:date_diff returns wrong results
 Status: Open
 Type:   Bug
 Package:Date/time related
 Operating System:   Windows Server 2008 R2 x64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Pay attention to the end of description. Windows 7 x64 doesn't have this
bug, 

while Windows Server 2008 R2 do and they have much more simiral codebase
than 

Windows XP and Windows Server 2008 R2.


Previous Comments:

[2011-01-30 15:09:38] an0nym at narod dot ru

I didn't compile myself. I downloaded VC6 x86 thread safe from windows
binaries 

php download page.


[2011-01-30 10:53:57] s...@php.net

Works fine for me on XP 32-bit with VC9. Which compiler/build did you
use?


[2011-01-29 23:42:08] an0nym at narod dot ru

Description:

See test script. 



On FreeBSD 8.1-RELEASE-p1 amd64, Linux 2.6.18-194.32.1.el5 x86_64,
Windows 7 x64 

everything works fine. 

Test script:
---
date_default_timezone_set("UTC");

$d = new DateTime("2011-01-01");

echo $d->diff(new DateTime("2010-01-01"))->format("%a");

Expected result:

365

Actual result:
--
6015






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


Bug #53880 [Fbk->Opn]: date_diff returns wrong results

2011-01-30 Thread an0nym at narod dot ru
Edit report at http://bugs.php.net/bug.php?id=53880&edit=1

 ID: 53880
 User updated by:an0nym at narod dot ru
 Reported by:an0nym at narod dot ru
 Summary:date_diff returns wrong results
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:Date/time related
 Operating System:   Windows Server 2008 R2 x64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

I didn't compile myself. I downloaded VC6 x86 thread safe from windows
binaries 

php download page.


Previous Comments:

[2011-01-30 10:53:57] s...@php.net

Works fine for me on XP 32-bit with VC9. Which compiler/build did you
use?


[2011-01-29 23:42:08] an0nym at narod dot ru

Description:

See test script. 



On FreeBSD 8.1-RELEASE-p1 amd64, Linux 2.6.18-194.32.1.el5 x86_64,
Windows 7 x64 

everything works fine. 

Test script:
---
date_default_timezone_set("UTC");

$d = new DateTime("2011-01-01");

echo $d->diff(new DateTime("2010-01-01"))->format("%a");

Expected result:

365

Actual result:
--
6015






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


Req #51118 [Opn]: Allow multiple simultaneous syslog connections

2011-01-30 Thread fat
Edit report at http://bugs.php.net/bug.php?id=51118&edit=1

 ID: 51118
 Updated by: f...@php.net
 Reported by:sylvain at abstraction dot fr
 Summary:Allow multiple simultaneous syslog connections
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
-PHP Version:5.2.12
+PHP Version:trunk
 Block user comment: N
 Private report: N

 New Comment:

as it changes openlog,syslog,closelog prototype, it should be apply to
trunk only


Previous Comments:

[2011-01-30 14:31:02] f...@php.net

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296394262
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296394262


[2011-01-30 14:23:31] f...@php.net

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296393811
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296393811


[2011-01-30 11:58:57] f...@php.net

The patch php-syslog.v1.patch add multiple syslog connexion and
enhancements of 

the syslog() PHP core functions.


[2011-01-30 11:58:01] f...@php.net

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296385081
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296385081


[2011-01-29 14:03:14] f...@php.net

I've just updated the patch with a compliant trunk patch.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=51118


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


Req #51118 [PATCH]: Allow multiple simultaneous syslog connections

2011-01-30 Thread f...@php.net
Edit report at http://bugs.php.net/bug.php?id=51118&edit=1

 ID: 51118
 Patch added by: f...@php.net
 Reported by:sylvain at abstraction dot fr
 Summary:Allow multiple simultaneous syslog connections
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:5.2.12
 Block user comment: N
 Private report: N

 New Comment:

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296394262
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296394262


Previous Comments:

[2011-01-30 14:23:31] f...@php.net

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296393811
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296393811


[2011-01-30 11:58:57] f...@php.net

The patch php-syslog.v1.patch add multiple syslog connexion and
enhancements of 

the syslog() PHP core functions.


[2011-01-30 11:58:01] f...@php.net

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296385081
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296385081


[2011-01-29 14:03:14] f...@php.net

I've just updated the patch with a compliant trunk patch.


[2011-01-29 14:02:29] f...@php.net

The following patch has been added/updated:

Patch Name: php_syslog_multiple_context.patch
Revision:   1296306149
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php_syslog_multiple_context.patch&revision=1296306149




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=51118


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


Req #51118 [PATCH]: Allow multiple simultaneous syslog connections

2011-01-30 Thread f...@php.net
Edit report at http://bugs.php.net/bug.php?id=51118&edit=1

 ID: 51118
 Patch added by: f...@php.net
 Reported by:sylvain at abstraction dot fr
 Summary:Allow multiple simultaneous syslog connections
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:5.2.12
 Block user comment: N
 Private report: N

 New Comment:

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296393811
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296393811


Previous Comments:

[2011-01-30 11:58:57] f...@php.net

The patch php-syslog.v1.patch add multiple syslog connexion and
enhancements of 

the syslog() PHP core functions.


[2011-01-30 11:58:01] f...@php.net

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296385081
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296385081


[2011-01-29 14:03:14] f...@php.net

I've just updated the patch with a compliant trunk patch.


[2011-01-29 14:02:29] f...@php.net

The following patch has been added/updated:

Patch Name: php_syslog_multiple_context.patch
Revision:   1296306149
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php_syslog_multiple_context.patch&revision=1296306149


[2010-07-23 13:11:41] sylvain at abstraction dot fr

Thank you very much for your time.



Hope it will be accepted in trunk.



Regards.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=51118


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


Bug #53789 [Com]: Setting session.hash_function doesn't change hash function used.

2011-01-30 Thread datahell at elxis dot org
Edit report at http://bugs.php.net/bug.php?id=53789&edit=1

 ID: 53789
 Comment by: datahell at elxis dot org
 Reported by:richard at blueapex dot co dot uk
 Summary:Setting session.hash_function doesn't change hash
 function used.
 Status: Open
 Type:   Bug
 Package:Session related
 Operating System:   Freebsd 8.1
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

I face the same problem on PHP 5.2.5 (x64) on my local installation
Windows Vista 64bit.


Previous Comments:

[2011-01-19 14:23:34] richard at blueapex dot co dot uk

Description:

This may be an apache bug, though I'll start with putting it down as
php. There is a similar bug: Bug #49469 submitted in 2009 with advice
try the latest snapshot, that was version 5.3.0 and I'm using version
5.3.5 so assuming that advice isn't valid and the bug still exists.



Setting session.hash_function variable in php.ini doesn't change the
value used to generate the hash function.



I've tried sha512, sha1, whirlpool. All of these don't change the hash
delivered to the browser (PHPSESSID) and still the standard md5() hash
is used.



All the hash algos tried are on the system when the output of
hash_algos() is examined.



Specifying 1 does make the system use SHA1 to generate the session
hash.



##



Revelant. php.ini



session.save_handler = files

session.use_cookies = 1

session.use_only_cookies = 1

session.name = PHPSESSID

session.auto_start = 0

session.cookie_lifetime = 0

session.cookie_path = /

session.cookie_domain =

session.cookie_httponly =

session.serialize_handler = php

session.gc_probability = 1

session.gc_divisor = 1000

session.gc_maxlifetime = 1440

session.bug_compat_42 = On

session.bug_compat_warn = On

session.referer_check =

session.entropy_length = 0

session.entropy_file =

session.cache_limiter = nocache

session.cache_expire = 180

session.use_trans_sid = 0

session.hash_function = sha512

session.hash_bits_per_character = 5

url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=fakeentry"

Test script:
---
session_start()

Expected result:

sha512 generated PHPSESSID

Actual result:
--
md5 generated PHPSESSID






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


Bug #53634 [Asn]: unknown property when writing to DateInterval::$days

2011-01-30 Thread danielc at analysisandsolutions dot com
Edit report at http://bugs.php.net/bug.php?id=53634&edit=1

 ID: 53634
 User updated by:danielc at analysisandsolutions dot com
 Reported by:danielc at analysisandsolutions dot com
 Summary:unknown property when writing to DateInterval::$days
 Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   linux
 PHP Version:5.3SVN-2010-12-30 (SVN)
 Assigned To:stas
 Block user comment: N
 Private report: N

 New Comment:

Why should days be read only?  All other properties are writable.  Days
needs to be writable too.  Writing to various properties is necessary
when overloading the date classes (to compensate for bugs, etc).


Previous Comments:

[2011-01-30 11:57:20] s...@php.net

Hmm... Actually you're not supposed to be writing to days property, it
should be read only. I'll fix it.


[2011-01-24 18:39:45] danielc at analysisandsolutions dot com

While the recent commit removes the fatal error, the property can not be
written to.  Here is the output of the initial test script (above) as of
svn revision 307713:



S: 8

DAYS: -9

DAYS: -9


[2011-01-24 03:49:50] s...@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




[2010-12-30 22:15:05] danielc at analysisandsolutions dot com

Description:

One can not set the DateInterval::$days property.  It is readable.  All
other properties of DateInterval shown in var_dump() are writeable.



While similar to Bug #52738, this involves an actual property of the
DateInterval class.



Test script:
---
$i = new DateInterval('P1D');

$i->s = 8;

echo "S: $i->s\n";

echo "DAYS: $i->days\n";

$i->days = 6;

echo "DAYS: $i->days\n";



Expected result:

S: 8

DAYS: -9

DAYS: 6



Actual result:
--
S: 8

DAYS: -9

PHP Fatal error:  main(): Unknown property (days) in
/home/danielc/test.php on line 7








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


Req #51118 [Com]: Allow multiple simultaneous syslog connections

2011-01-30 Thread f...@php.net
Edit report at http://bugs.php.net/bug.php?id=51118&edit=1

 ID: 51118
 Comment by: f...@php.net
 Reported by:sylvain at abstraction dot fr
 Summary:Allow multiple simultaneous syslog connections
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:5.2.12
 Block user comment: N
 Private report: N

 New Comment:

The patch php-syslog.v1.patch add multiple syslog connexion and
enhancements of 

the syslog() PHP core functions.


Previous Comments:

[2011-01-30 11:58:01] f...@php.net

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296385081
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296385081


[2011-01-29 14:03:14] f...@php.net

I've just updated the patch with a compliant trunk patch.


[2011-01-29 14:02:29] f...@php.net

The following patch has been added/updated:

Patch Name: php_syslog_multiple_context.patch
Revision:   1296306149
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php_syslog_multiple_context.patch&revision=1296306149


[2010-07-23 13:11:41] sylvain at abstraction dot fr

Thank you very much for your time.



Hope it will be accepted in trunk.



Regards.


[2010-07-23 05:30:28] f...@php.net

I just attached a patch which should do the trick. I don't know if it'll
be 

accepted by the dev team who handle this part of PHP.



openlog() returns a ressource instead of a bool.



closelog() and syslog() have now a last and optional parameter: a
context 

ressource.



Everything which was working before, should still work. The only change
is the 

return value of openlog() which should be strictely compared
(openlog(...) !== 

true).



here is a sample test script:








The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=51118


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


Req #51118 [PATCH]: Allow multiple simultaneous syslog connections

2011-01-30 Thread f...@php.net
Edit report at http://bugs.php.net/bug.php?id=51118&edit=1

 ID: 51118
 Patch added by: f...@php.net
 Reported by:sylvain at abstraction dot fr
 Summary:Allow multiple simultaneous syslog connections
 Status: Open
 Type:   Feature/Change Request
 Package:*General Issues
 Operating System:   all
 PHP Version:5.2.12
 Block user comment: N
 Private report: N

 New Comment:

The following patch has been added/updated:

Patch Name: php-syslog.patch
Revision:   1296385081
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php-syslog.patch&revision=1296385081


Previous Comments:

[2011-01-29 14:03:14] f...@php.net

I've just updated the patch with a compliant trunk patch.


[2011-01-29 14:02:29] f...@php.net

The following patch has been added/updated:

Patch Name: php_syslog_multiple_context.patch
Revision:   1296306149
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php_syslog_multiple_context.patch&revision=1296306149


[2010-07-23 13:11:41] sylvain at abstraction dot fr

Thank you very much for your time.



Hope it will be accepted in trunk.



Regards.


[2010-07-23 05:30:28] f...@php.net

I just attached a patch which should do the trick. I don't know if it'll
be 

accepted by the dev team who handle this part of PHP.



openlog() returns a ressource instead of a bool.



closelog() and syslog() have now a last and optional parameter: a
context 

ressource.



Everything which was working before, should still work. The only change
is the 

return value of openlog() which should be strictely compared
(openlog(...) !== 

true).



here is a sample test script:






[2010-07-23 05:23:41] f...@php.net

The following patch has been added/updated:

Patch Name: php_syslog_multiple_context.patch
Revision:   1279855421
URL:   
http://bugs.php.net/patch-display.php?bug=51118&patch=php_syslog_multiple_context.patch&revision=1279855421




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=51118


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


Bug #53634 [Asn]: unknown property when writing to DateInterval::$days

2011-01-30 Thread stas
Edit report at http://bugs.php.net/bug.php?id=53634&edit=1

 ID: 53634
 Updated by: s...@php.net
 Reported by:danielc at analysisandsolutions dot com
 Summary:unknown property when writing to DateInterval::$days
 Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   linux
 PHP Version:5.3SVN-2010-12-30 (SVN)
 Assigned To:stas
 Block user comment: N
 Private report: N

 New Comment:

Hmm... Actually you're not supposed to be writing to days property, it
should be read only. I'll fix it.


Previous Comments:

[2011-01-24 18:39:45] danielc at analysisandsolutions dot com

While the recent commit removes the fatal error, the property can not be
written to.  Here is the output of the initial test script (above) as of
svn revision 307713:



S: 8

DAYS: -9

DAYS: -9


[2011-01-24 03:49:50] s...@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




[2010-12-30 22:15:05] danielc at analysisandsolutions dot com

Description:

One can not set the DateInterval::$days property.  It is readable.  All
other properties of DateInterval shown in var_dump() are writeable.



While similar to Bug #52738, this involves an actual property of the
DateInterval class.



Test script:
---
$i = new DateInterval('P1D');

$i->s = 8;

echo "S: $i->s\n";

echo "DAYS: $i->days\n";

$i->days = 6;

echo "DAYS: $i->days\n";



Expected result:

S: 8

DAYS: -9

DAYS: 6



Actual result:
--
S: 8

DAYS: -9

PHP Fatal error:  main(): Unknown property (days) in
/home/danielc/test.php on line 7








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


Bug #53795 [Asn]: Connect Error from MySqli (mysqlnd) when using SSL

2011-01-30 Thread kalle
Edit report at http://bugs.php.net/bug.php?id=53795&edit=1

 ID: 53795
 Updated by: ka...@php.net
 Reported by:dave dot kelly at dawkco dot com
 Summary:Connect Error from MySqli (mysqlnd) when using SSL
 Status: Assigned
 Type:   Bug
 Package:MySQLi related
 Operating System:   Windows
 PHP Version:5.3.5
-Assigned To:mysql
+Assigned To:kalle
 Block user comment: N
 Private report: N

 New Comment:

I got an idea why this fails, as MYSQLND_SSL_SUPPORTED is not defined on
Windows, its a simple one line fix that I will commit shortly


Previous Comments:

[2011-01-29 09:36:07] dave dot kelly at dawkco dot com

FYI (you probably already know):  there are currently no SSL/TLS options
available to be set with the mysqli::options method.



I tried using the mysqli::ssl_set method as follows, but it didn't work
either (same connect error):



$mysqli->ssl_set(NULL, // key file path or NULL

 NULL, // cert file path or NULL

 'C:/ssl/ca-cert.pem', // ca cert file path or NULL

 NULL, // capath directory or NULL

 'DHE-RSA-AES256-SHA'); // cipher or NULL



Also, tried the following (no luck):



$mysqli->ssl_set('C:/ssl/key.pem', // key file path or NULL

 'C:/ssl/cert.pem', // cert file path or NULL

 'C:/ssl/ca-cert.pem', // ca cert file path or NULL

 NULL, // capath directory or NULL

 NULL); // cipher or NULL



As noted before, these all work with PHP 5.2.17, but not with PHP
5.3.5.



A fix for mysqlnd would be great because trying to do a custom build on
Windows with mysqlnd disabled has become a real ordeal.


[2011-01-24 11:12:59] and...@php.net

No, mysqlnd doesn't use my.ini/my.cnf files, as libmysql did. You have
to set your options manually.


[2011-01-24 10:21:41] u...@php.net

mysqlnd does not read default files, AFAIK. I think Andrey wants to
deprecate that, Andrey?


[2011-01-20 01:59:47] dave dot kelly at dawkco dot com

Description:

- Using PHP 5.3.5 Windows binaries (Zip package).

- extension = php_mysqli.dll is enabled in php.ini.

- trying to use mysqli::real_connect, passing MYSQLI_CLIENT_SSL in the
flags parameter.



It returns the following error:



Warning: mysqli::real_connect() [mysqli.real-connect.html]:
(28000/1045): Access denied for user 'user'@'host' (using password: YES)
in C:\Apache22\htdocs\test.php on line 25

Connect Error (1045)



If I switch to PHP 5.2.17 Windows binaries (Zip package), using the
exact same settings and script, I get the following (excerpts):



Success... host via TCP/IP

...

Ssl_cipher DHE-RSA-AES256-SHA

...

Ssl_version TLSv1



I believe the main difference (relevant to this problem) between PHP
5.2.17 and PHP 5.3.5 is that 5.2.17 uses libmysql.dll and 5.3.5 uses
built-in mysqlnd (native driver).  So, it appears that libmysql.dll
works with SSL, while built-in mysqlnd (native driver) cannot use SSL. 
The Windows binaries build has no way to disable/enable mysqlnd and/or
libmysql.  If mysqlnd is not going to work with SSL, there should at
least be another option that can be configured at runtime with the
options file.



Test script:
---
init();

if (!$mysqli->options(MYSQLI_READ_DEFAULT_FILE,

'C:/Program Files/MySQL/my.ini')) {

  die('Setting MYSQLI_READ_DEFAULT_FILE failed');

}

if (!$mysqli->options(MYSQLI_READ_DEFAULT_GROUP, 'mysql')) {

  die('Setting MYSQLI_READ_DEFAULT_GROUP failed');

}

if (!$mysqli->real_connect('host', 'user', 'pass',

'mydb', 3306, NULL, MYSQLI_CLIENT_SSL)) {

  echo 'Connect Error (' . mysqli_connect_errno() . ')' . "\n";

}

else {

  echo 'Success... ' . $mysqli->host_info . "\n";

  $sql = "show status like '%ssl%'";

  $result = $mysqli->query($sql);

  while ($row = $result->fetch_array()) {

echo $row[0] . ' ' . $row[1] . "\n";

  }

  if ($result) { $result->close(); }

}

$mysqli->close(); ?>

Expected result:

Expect a new SSL connection and a result set from the query indicating
that the connection is indeed via SSL/TLS.

Actual result:
--
Warning: (28000/1045): Access denied ... Connect Error (1045).






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


Bug #48187 [Opn->Fbk]: DateTime::diff() corrupting microtime() result

2011-01-30 Thread stas
Edit report at http://bugs.php.net/bug.php?id=48187&edit=1

 ID: 48187
 Updated by: s...@php.net
 Reported by:wavetrex at gmail dot com
 Summary:DateTime::diff() corrupting microtime() result
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Date/time related
 Operating System:   Windows 2003 Server
 PHP Version:5.3.0RC2
 Block user comment: N
 Private report: N

 New Comment:

Is it VC6-based build? If yes, could you try a VC9-based build instead?


Previous Comments:

[2010-08-13 20:59:29] alpha_centurion at hotmail dot com

Reproduced on Win32 XP SP3 with Apache 2.2.15 and php
5.3.2-Win32-VC6-x86



Only seems to impact web requests as same script (by jani) does not
evidence the same error when run on the command line.


[2010-08-10 07:01:03] jasonjoo dot god at gmail dot com

my test script below:

diff(new DateTime());

echo microtime(true);

?>

and my os is win32/xp

I found this isue can be reproduced under apache in handler mode, but it
is no isue in command line mode(eg. php test.php).



for example, I got its output like this:

1281415176.9756

1281402595.446

and the wrong one only change the part following dot



my php version is 5.3.3


[2010-07-18 00:47:15] k.schroe...@php.net

Automatic comment from SVN on behalf of k.schroeder
Revision: http://svn.php.net/viewvc/?view=revision&revision=301359
Log: Test for #48187


[2009-05-10 01:41:59] wavetrex at gmail dot com

float(1241919300.3593)

float(1241709350.3736)

int(1241919300)

int(1241919300)

string(25) "2009-05-10T04:35:00+03:00"

string(25) "2009-05-10T04:35:00+03:00"



( http://wt.ath.cx/jani.php )



Note: 1241709350 -> this value seems to stay almost unchanged over time


(look at my first submission: string(21) "0.25882200 1241709345" )



When I reported the difference was ~5 seconds, now it's over 200.000


[2009-05-09 20:59:00] j...@php.net

What is the output of the script I provided?




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=48187


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


Bug #52798 [Fbk]: dateTime => function diff => days KO

2011-01-30 Thread stas
Edit report at http://bugs.php.net/bug.php?id=52798&edit=1

 ID: 52798
 Updated by: s...@php.net
 Reported by:ebinachon at pierre-vacances dot fr
 Summary:dateTime => function diff => days KO
 Status: Feedback
 Type:   Bug
 Package:Date/time related
 Operating System:   windows xp
 PHP Version:5.3.3
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

Also, please try vc9 build.


Previous Comments:

[2011-01-30 10:49:36] s...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Works fine for me with current SVN 5.3 HEAD.


[2010-09-08 18:12:46] cataphr...@php.net

The problem was the call to floor().



The compiler gave a warning:

"d:\users\cataphract\documents\php-trunk\ext\date\lib\interval.c(57) :
warning C4013: 'floor' undefined; assuming extern returning int"



The assumption is wrong, because it calls



double  __cdecl floor(_In_ double _X);



Which takes and returns a larger type.



I removed the call to floor, which is unnecessary since it's an integer
division.



I also changed the call to abs to a call to llabs to avoid the
conversion from long long to int and then to long long again.


[2010-09-08 18:03:46] cataphr...@php.net

The following patch has been added/updated:

Patch Name: date_diff
Revision:   1283961826
URL:   
http://bugs.php.net/patch-display.php?bug=52798&patch=date_diff&revision=1283961826


[2010-09-08 17:36:02] cataphr...@php.net

I can reproduce only on Windows. The exactly value varies (seems to be
garbage memory).


[2010-09-08 17:19:52] ebinachon at pierre-vacances dot fr

Description:

I have a probleme with the function diff of dateTime.

When i do a test, the "days" result is always : 6015.

All the other informations ( Y, m, d, ... ) are correct.



Have-you an idea ?



Test script:
---
Exemple :

$date1 = new DateTime('2010-01-01');

$date2 = new DateTime('2010-03-13');

$interval = $date2->diff($date1);

Zend_Debug::dump($interval);

//OR 

Zend_Debug::dump($interval->format('%a'));



--



Result :

object(DateInterval)#174 (8) {

  ["y"] => int(0)

  ["m"] => int(2)

  ["d"] => int(12)

  ["h"] => int(0)

  ["i"] => int(0)

  ["s"] => int(0)

  ["invert"] => int(0)

  ["days"] => int(6015)

}

Expected result:

days => 71

Actual result:
--
days => 6015






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


Bug #52290 [Asn->Csd]: setDate, setISODate, setTime works wrong when DateTime created from timestamp

2011-01-30 Thread stas
Edit report at http://bugs.php.net/bug.php?id=52290&edit=1

 ID: 52290
 Updated by: s...@php.net
 Reported by:danikas2k2 at gmail dot com
 Summary:setDate, setISODate, setTime works wrong when
 DateTime created from timestamp
-Status: Assigned
+Status: Closed
 Type:   Bug
 Package:Date/time related
 Operating System:   WinXP x86
 PHP Version:5.3.2
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2011-01-30 11:18:14] s...@php.net

Automatic comment from SVN on behalf of stas
Revision: http://svn.php.net/viewvc/?view=revision&revision=307853
Log: Fix bug #52290 (setDate, setISODate, setTime works wrong when
DateTime created from timestamp)


[2010-07-17 23:57:18] k.schroe...@php.net

Automatic comment from SVN on behalf of k.schroeder
Revision: http://svn.php.net/viewvc/?view=revision&revision=301357
Log: Test for #52290


[2010-07-08 15:29:29] danikas2k2 at gmail dot com

Description:

setDate, setISODate, setTime works wrong

Test script:
---
$tz = 'UTC';

date_default_timezone_set($tz);



$ts = strtotime('2006-01-01');

$dt = new DateTime('@'.$ts);

$dt->setTimezone(new DateTimeZone($tz));



echo $dt->format('o-\WW-N | Y-m-d | H:i:s | U'), "\n";



$dt->setISODate(2005, 52, 1);

echo $dt->format('o-\WW-N | Y-m-d | H:i:s | U'), "\n";



$dt->setDate(2007, 10, 10);

echo $dt->format('o-\WW-N | Y-m-d | H:i:s | U'), "\n";



$dt->setTime(20, 30, 40);

echo $dt->format('o-\WW-N | Y-m-d | H:i:s | U'), "\n";



Expected result:

2005-W52-7 | 2006-01-01 | 00:00:00

2005-W52-1 | 2005-12-26 | 00:00:00

2007-W40-5 | 2007-10-10 | 00:00:00

2007-W40-5 | 2007-10-10 | 20:30:40



Actual result:
--
2005-W52-7 | 2006-01-01 | 00:00:00 | 1136073600

2041-W52-4 | 2041-12-26 | 00:00:00 | 2271628800

2044-W40-1 | 2044-10-03 | 00:00:00 | 2359065600

2081-W39-6 | 2081-09-27 | 20:30:40 | 3526230640








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


Bug #53847 [Fbk]: Crash after setting $field in mysql_result to NULL

2011-01-30 Thread kalle
Edit report at http://bugs.php.net/bug.php?id=53847&edit=1

 ID: 53847
 Updated by: ka...@php.net
 Reported by:ps at tns dot cz
 Summary:Crash after setting $field in mysql_result to NULL
 Status: Feedback
 Type:   Bug
 Package:MySQL related
 Operating System:   FreeBSD 8.1-RELEASE-p1 amd64
 PHP Version:5.3.5
-Assigned To:
+Assigned To:kalle
 Block user comment: N
 Private report: N

 New Comment:

Looking at the source, this could be due to a similar crash in the
fetching functions with int<->long on 64bit:



zif_mysql_result declares a variable called field_offset to 1. After the
parameters is processed, the function will check the value of $field
which will be cast to a long and put into the int variable:
"field_offset = Z_LVAL_P(field);".



Try changing line 1880 of ext/mysql/php_mysql.c in the latest 5.3 source
(from SVN) from 'int' to 'long'.


Previous Comments:

[2011-01-30 11:07:02] ka...@php.net

Could you try without the Suhosin patch (as we don't supported patched
versions), and does this happen when the mysql extension is linked
specifically to libmysql or mysqlnd?


[2011-01-26 13:40:02] ps at tns dot cz

Description:

Assigning of value NULL to $field argument of mysql_result causes
segmentation fault.



PHP version: PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 10 2011
14:50:28)



Installed modules:

php5-ctype-5.3.5

php5-curl-5.3.5

php5-dom-5.3.5

php5-ftp-5.3.5

php5-gd-5.3.5

php5-hash-5.3.5

php5-iconv-5.3.5

php5-json-5.3.5

php5-mbstring-5.3.5

php5-mcrypt-5.3.5

php5-mysql-5.3.5

php5-mysqli-5.3.5

php5-openssl-5.3.5

php5-session-5.3.5

php5-simplexml-5.3.5

php5-soap-5.3.5

php5-tidy-5.3.5

php5-tokenizer-5.3.5

php5-xml-5.3.5

php5-zip-5.3.5

php5-zlib-5.3.5



Diff for php.ini:

http://pastebin.com/5D1WsneT



Test script:
---
http://pastebin.com/2D4mVyEx

Expected result:

Script should run and output nothing.

Actual result:
--
Segmentation fault. Problem is the wrong assigning of value NULL to
$field argument of mysql_result on lines 13-14.



Weird is that commenting out one line of for example lines 31, 32 or 33
avoids the crash.



Cannot reproduce with Zend MM disabled.



Cannot reproduce with PHP compiled with debug option (!).



Backtrace (not useful since debug must be disabled)
http://pastebin.com/KksuenGw



Valgrind log (I guess not useful eighter since debug must be disabled)
http://pastebin.com/vu9nsLLT






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


Bug #53847 [Opn->Fbk]: Crash after setting $field in mysql_result to NULL

2011-01-30 Thread kalle
Edit report at http://bugs.php.net/bug.php?id=53847&edit=1

 ID: 53847
 Updated by: ka...@php.net
 Reported by:ps at tns dot cz
 Summary:Crash after setting $field in mysql_result to NULL
-Status: Open
+Status: Feedback
 Type:   Bug
-Package:Reproducible crash
+Package:MySQL related
 Operating System:   FreeBSD 8.1-RELEASE-p1 amd64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Could you try without the Suhosin patch (as we don't supported patched
versions), and does this happen when the mysql extension is linked
specifically to libmysql or mysqlnd?


Previous Comments:

[2011-01-26 13:40:02] ps at tns dot cz

Description:

Assigning of value NULL to $field argument of mysql_result causes
segmentation fault.



PHP version: PHP 5.3.5 with Suhosin-Patch (cli) (built: Jan 10 2011
14:50:28)



Installed modules:

php5-ctype-5.3.5

php5-curl-5.3.5

php5-dom-5.3.5

php5-ftp-5.3.5

php5-gd-5.3.5

php5-hash-5.3.5

php5-iconv-5.3.5

php5-json-5.3.5

php5-mbstring-5.3.5

php5-mcrypt-5.3.5

php5-mysql-5.3.5

php5-mysqli-5.3.5

php5-openssl-5.3.5

php5-session-5.3.5

php5-simplexml-5.3.5

php5-soap-5.3.5

php5-tidy-5.3.5

php5-tokenizer-5.3.5

php5-xml-5.3.5

php5-zip-5.3.5

php5-zlib-5.3.5



Diff for php.ini:

http://pastebin.com/5D1WsneT



Test script:
---
http://pastebin.com/2D4mVyEx

Expected result:

Script should run and output nothing.

Actual result:
--
Segmentation fault. Problem is the wrong assigning of value NULL to
$field argument of mysql_result on lines 13-14.



Weird is that commenting out one line of for example lines 31, 32 or 33
avoids the crash.



Cannot reproduce with Zend MM disabled.



Cannot reproduce with PHP compiled with debug option (!).



Backtrace (not useful since debug must be disabled)
http://pastebin.com/KksuenGw



Valgrind log (I guess not useful eighter since debug must be disabled)
http://pastebin.com/vu9nsLLT






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


Bug #53880 [Opn->Fbk]: date_diff returns wrong results

2011-01-30 Thread stas
Edit report at http://bugs.php.net/bug.php?id=53880&edit=1

 ID: 53880
 Updated by: s...@php.net
 Reported by:an0nym at narod dot ru
 Summary:date_diff returns wrong results
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Date/time related
 Operating System:   Windows Server 2008 R2 x64
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Works fine for me on XP 32-bit with VC9. Which compiler/build did you
use?


Previous Comments:

[2011-01-29 23:42:08] an0nym at narod dot ru

Description:

See test script. 



On FreeBSD 8.1-RELEASE-p1 amd64, Linux 2.6.18-194.32.1.el5 x86_64,
Windows 7 x64 

everything works fine. 

Test script:
---
date_default_timezone_set("UTC");

$d = new DateTime("2011-01-01");

echo $d->diff(new DateTime("2010-01-01"))->format("%a");

Expected result:

365

Actual result:
--
6015






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


Bug #52798 [Ver->Fbk]: dateTime => function diff => days KO

2011-01-30 Thread stas
Edit report at http://bugs.php.net/bug.php?id=52798&edit=1

 ID: 52798
 Updated by: s...@php.net
 Reported by:ebinachon at pierre-vacances dot fr
 Summary:dateTime => function diff => days KO
-Status: Verified
+Status: Feedback
 Type:   Bug
 Package:Date/time related
 Operating System:   windows xp
 PHP Version:5.3.3
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Works fine for me with current SVN 5.3 HEAD.


Previous Comments:

[2010-09-08 18:12:46] cataphr...@php.net

The problem was the call to floor().



The compiler gave a warning:

"d:\users\cataphract\documents\php-trunk\ext\date\lib\interval.c(57) :
warning C4013: 'floor' undefined; assuming extern returning int"



The assumption is wrong, because it calls



double  __cdecl floor(_In_ double _X);



Which takes and returns a larger type.



I removed the call to floor, which is unnecessary since it's an integer
division.



I also changed the call to abs to a call to llabs to avoid the
conversion from long long to int and then to long long again.


[2010-09-08 18:03:46] cataphr...@php.net

The following patch has been added/updated:

Patch Name: date_diff
Revision:   1283961826
URL:   
http://bugs.php.net/patch-display.php?bug=52798&patch=date_diff&revision=1283961826


[2010-09-08 17:36:02] cataphr...@php.net

I can reproduce only on Windows. The exactly value varies (seems to be
garbage memory).


[2010-09-08 17:19:52] ebinachon at pierre-vacances dot fr

Description:

I have a probleme with the function diff of dateTime.

When i do a test, the "days" result is always : 6015.

All the other informations ( Y, m, d, ... ) are correct.



Have-you an idea ?



Test script:
---
Exemple :

$date1 = new DateTime('2010-01-01');

$date2 = new DateTime('2010-03-13');

$interval = $date2->diff($date1);

Zend_Debug::dump($interval);

//OR 

Zend_Debug::dump($interval->format('%a'));



--



Result :

object(DateInterval)#174 (8) {

  ["y"] => int(0)

  ["m"] => int(2)

  ["d"] => int(12)

  ["h"] => int(0)

  ["i"] => int(0)

  ["s"] => int(0)

  ["invert"] => int(0)

  ["days"] => int(6015)

}

Expected result:

days => 71

Actual result:
--
days => 6015






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


Bug #53883 [Opn->Bgs]: I don't understand

2011-01-30 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=53883&edit=1

 ID: 53883
 Updated by: ras...@php.net
 Reported by:limseiryu at gmail dot com
 Summary:I don't understand
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:*Math Functions
 Operating System:   Windows 7
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

It's not a bug and this is not a support forum.  Use range() if you want
to 

generate ranges like that, not a loop.  The comparisons are the way they
are to 

make natural ordering more useful.


Previous Comments:

[2011-01-30 09:41:06] limseiryu at gmail dot com

Description:

//When i type this code,







//it appears : a b c d e f g h i j k l m n o p q r s t u v w x y



//but when i type the code like this,







/*

it appears :



a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag
ah ai 

aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg
bh bi bj 

bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch
ci cj ck 

cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di
dj dk dl 

dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej
ek el em 

en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk
fl fm fn 

fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl
gm gn go 

gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm
hn ho hp 

hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in
io ip iq 

ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo
jp jq jr 

js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp
kq kr ks 

kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq
lr ls lt 

lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr
ms mt mu 

mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns
nt nu nv 

nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot
ou ov ow 

ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu
pv pw px 

py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv
qw qx qy 

qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw
rx ry rz 

sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx
sy sz ta 

tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty
tz ua ub 

uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz
va vb vc 

vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa
wb wc wd 

we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb
xc xd xe 

xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc
yd ye yf 

yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz

*/



#i dunno if this is really a bug, i just wanna know

#Thanks Before

Test script:
---




Expected result:

a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag
ah ai 

aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg
bh bi bj 

bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch
ci cj ck 

cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di
dj dk dl 

dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej
ek el em 

en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk
fl fm fn 

fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl
gm gn go 

gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm
hn ho hp 

hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in
io ip iq 

ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo
jp jq jr 

js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp
kq kr ks 

kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq
lr ls lt 

lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr
ms mt mu 

mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns
nt nu nv 

nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot
ou ov ow 

ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu
pv pw px 

py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv
qw qx qy 

qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw
rx ry rz 

sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx
sy sz ta 

tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty
tz ua ub 

uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz
va vb vc 

vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa
wb wc wd 

we wf 

Bug #52808 [Asn->Csd]: Segfault when specifying interval as two dates

2011-01-30 Thread stas
Edit report at http://bugs.php.net/bug.php?id=52808&edit=1

 ID: 52808
 Updated by: s...@php.net
 Reported by:j...@php.net
 Summary:Segfault when specifying interval as two dates
-Status: Assigned
+Status: Closed
 Type:   Bug
 Package:Date/time related
 Operating System:   Debian stable
 PHP Version:5.3, trunk
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2011-01-30 09:54:55] s...@php.net

Automatic comment from SVN on behalf of stas
Revision: http://svn.php.net/viewvc/?view=revision&revision=307846
Log: Fix bug #52808 (Segfault when specifying interval as two dates)


[2010-09-11 00:22:09] srina...@php.net

looks like my comment was lost in the previous post while uploading my
patch.



i was wondering, if dateinterval constructor accepts a general format of
date string. looking at the code it does not seem to be as well. 



manual suggests that you need to provide the input date in format
ISO8601 format. 



for example year 10th may, 2008 would be given as 

$a = new DateInterval("P2008Y5M11DT15H30M00S");



I haven't used this API much.So, I could be wrong.


[2010-09-09 23:45:25] j...@php.net

Description:

Creating an interval with a "negative duration" (i.e., "start" date
precedes "end" date) creates what appears to be a valid DateInterval
object, but any attempt to work with the object results in a segfault.

Test script:
---


Expected result:

At a minimum, "Not crashing". Ideally, a DateInterval object with a
negative duration, but I don't know of ISO-8601 allows those.

Actual result:
--


(gdb) r -r '$a = new
DateInterval("2008-05-11T15:30:00Z/2007-03-01T13:00:00Z");
var_dump($a);'



Program received signal SIGSEGV, Segmentation fault.

0x00420faf in date_object_get_properties_interval (object=) at /home/joey/src/php/trunk/ext/date/php_date.c:2242

2242PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);



"bt full" output available at http://codepad.org/on7ZS6Qd






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


[PHP-BUG] Bug #53883 [NEW]: I don't understand

2011-01-30 Thread limseiryu at gmail dot com
From: 
Operating system: Windows 7
PHP version:  5.3.5
Package:  *Math Functions
Bug Type: Bug
Bug description:I don't understand

Description:

//When i type this code,







//it appears : a b c d e f g h i j k l m n o p q r s t u v w x y



//but when i type the code like this,







/*

it appears :



a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah
ai 

aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh
bi bj 

bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci
cj ck 

cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj
dk dl 

dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek
el em 

en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl
fm fn 

fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm
gn go 

gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn
ho hp 

hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io
ip iq 

ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp
jq jr 

js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq
kr ks 

kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr
ls lt 

lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms
mt mu 

mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt
nu nv 

nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou
ov ow 

ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv
pw px 

py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw
qx qy 

qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx
ry rz 

sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy
sz ta 

tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz
ua ub 

uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va
vb vc 

vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb
wc wd 

we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc
xd xe 

xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd
ye yf 

yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz

*/



#i dunno if this is really a bug, i just wanna know

#Thanks Before

Test script:
---




Expected result:

a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah
ai 

aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh
bi bj 

bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci
cj ck 

cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj
dk dl 

dm dn do dp dq dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh ei ej ek
el em 

en eo ep eq er es et eu ev ew ex ey ez fa fb fc fd fe ff fg fh fi fj fk fl
fm fn 

fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gf gg gh gi gj gk gl gm
gn go 

gp gq gr gs gt gu gv gw gx gy gz ha hb hc hd he hf hg hh hi hj hk hl hm hn
ho hp 

hq hr hs ht hu hv hw hx hy hz ia ib ic id ie if ig ih ii ij ik il im in io
ip iq 

ir is it iu iv iw ix iy iz ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp
jq jr 

js jt ju jv jw jx jy jz ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq
kr ks 

kt ku kv kw kx ky kz la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr
ls lt 

lu lv lw lx ly lz ma mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms
mt mu 

mv mw mx my mz na nb nc nd ne nf ng nh ni nj nk nl nm nn no np nq nr ns nt
nu nv 

nw nx ny nz oa ob oc od oe of og oh oi oj ok ol om on oo op oq or os ot ou
ov ow 

ox oy oz pa pb pc pd pe pf pg ph pi pj pk pl pm pn po pp pq pr ps pt pu pv
pw px 

py pz qa qb qc qd qe qf qg qh qi qj qk ql qm qn qo qp qq qr qs qt qu qv qw
qx qy 

qz ra rb rc rd re rf rg rh ri rj rk rl rm rn ro rp rq rr rs rt ru rv rw rx
ry rz 

sa sb sc sd se sf sg sh si sj sk sl sm sn so sp sq sr ss st su sv sw sx sy
sz ta 

tb tc td te tf tg th ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz
ua ub 

uc ud ue uf ug uh ui uj uk ul um un uo up uq ur us ut uu uv uw ux uy uz va
vb vc 

vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz wa wb
wc wd 

we wf wg wh wi wj wk wl wm wn wo wp wq wr ws wt wu wv ww wx wy wz xa xb xc
xd xe 

xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz ya yb yc yd
ye yf 

yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu yv yw yx yy yz

Actual result:
--
a b c d e f g h i j k l m n o p q r s t u v w x y z

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53883&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53883&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53883&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php