#50971 [Opn-Fbk]: imagettftext/imagettfbbox return wrong coordinates if angle != 0

2010-02-09 Thread pajoye
 ID:   50971
 Updated by:   paj...@php.net
 Reported By:  sks76543210 at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: GD related
 Operating System: CentOS 5
 PHP Version:  5.3SVN-2010-02-09 (snap)
 New Comment:

Which GD library do you use? Bundled?


Previous Comments:


[2010-02-09 06:39:41] sks76543210 at gmail dot com

Description:

imagettftext() and imagettfbbox() both return wrong bounding box if the
angle is not set to 0. This sounds similar to a bug closed last year at
http://bugs.php.net/bug.php?id=43073

See http://www.yessum.org/gdbug2/ for font and samples. This bug
appears to be in 5.1.6, and has since gotten worse in the latest svn. 

Also, in 5.3.3-dev, the text doesn't seem to even be on the same
baseline on many of the angles.

Reproduce code:
---
?php
$font = './cour.ttf'; // Courier New

$im = imagecreatetruecolor(600, 600);

imagefill($im, 0, 0, imagecolorallocate($im, 224, 224, 224));
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);

$angle = 0;
do {
$bbox = imagettftext($im, 16, $angle, 299, 299, $black, $font,
'The quick brown fox');
imagepolygon($im, $bbox, 4, $red);
$angle += 45;
} while ($angle  360);

header('content-type: image/png');
imagepng($im);

Expected result:

The bounding box should be a bounding box

Actual result:
--
The string is not contained in the bounding box.





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



#50971 [Fbk-Opn]: imagettftext/imagettfbbox return wrong coordinates if angle != 0

2010-02-09 Thread sks76543210 at gmail dot com
 ID:   50971
 User updated by:  sks76543210 at gmail dot com
 Reported By:  sks76543210 at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: GD related
 Operating System: CentOS 5
 PHP Version:  5.3SVN-2010-02-09 (snap)
 New Comment:

The bug occurs in the two PHP versions I have available to test on
here. Perhaps I can try on a win32 box when I get to work.

PHP 5.3.3-dev compiled from src
---
GD Version: bundled (2.0.34 compatible)
Freetype Version: 2.2.1

./configure  --with-apxs2=/home/user/bin/httpd/bin/apxs
--prefix=/home/user/bin/php --with-pdo-mysql --with-zlib --with-gd
--with-gettext --with-freetype-dir --enable-gd-native-ttf



PHP 5.1.6 from centos rpms
--
GD Version: bundled (2.0.28 compatible) 
FreeType Version 2.2.1


Previous Comments:


[2010-02-09 09:53:59] paj...@php.net

Which GD library do you use? Bundled?



[2010-02-09 06:39:41] sks76543210 at gmail dot com

Description:

imagettftext() and imagettfbbox() both return wrong bounding box if the
angle is not set to 0. This sounds similar to a bug closed last year at
http://bugs.php.net/bug.php?id=43073

See http://www.yessum.org/gdbug2/ for font and samples. This bug
appears to be in 5.1.6, and has since gotten worse in the latest svn. 

Also, in 5.3.3-dev, the text doesn't seem to even be on the same
baseline on many of the angles.

Reproduce code:
---
?php
$font = './cour.ttf'; // Courier New

$im = imagecreatetruecolor(600, 600);

imagefill($im, 0, 0, imagecolorallocate($im, 224, 224, 224));
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);

$angle = 0;
do {
$bbox = imagettftext($im, 16, $angle, 299, 299, $black, $font,
'The quick brown fox');
imagepolygon($im, $bbox, 4, $red);
$angle += 45;
} while ($angle  360);

header('content-type: image/png');
imagepng($im);

Expected result:

The bounding box should be a bounding box

Actual result:
--
The string is not contained in the bounding box.





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



#44872 [Com]: canary mismatch on efree() - heap overflow detected

2010-02-09 Thread jimmy at pixelant dot se
 ID:   44872
 Comment by:   jimmy at pixelant dot se
 Reported By:  mattr at shoplet dot com
 Status:   No Feedback
 Bug Type: MySQLi related
 Operating System: FreeBSD 6.2
 PHP Version:  5.2.5
 New Comment:

Feb  9 13:51:36 xx suhosin[4498]: ALERT - canary mismatch
on efree() - heap overflow detected (attacker 'x.x.x.x', file
'class.t3lib_htmlmail.php', line 718)


Upgrade to php 5.2.12 resolved this issue.


Previous Comments:


[2009-09-09 20:51:05] squarious at gmail dot com

I have the same error on 5.2.10 with suhosin patch.
Linux 2.6.31-10-generic #30-Ubuntu SMP Tue Sep 8 12:32:38 UTC 2009
x86_64 GNU/Linux

The tested site was working perfectly on Ubuntu 8.04 LTS with untouched
PHP 5.2.4 (with suhosin patch). The behaviour however is not standard
and it depends if the page is first time visite



[2009-09-09 12:03:27] neofutur dot php at ww7 dot be

update/workaround . . . but scary . . .

 someone on ##php tols me to restart apache, that when you get one of 
those canary mismatch on efree() you get many until you restart apache.
 I didnt pay attention at the beginning but finally tried it.

 Its simply true, when you get those messages , restart apache and you
will see no more of them ( until the next apache overflow ? )



[2009-09-09 10:21:49] neofutur dot php at ww7 dot be

I also tried the code suggested :

?php
$demo_user[]=(object)array(first = 1);
$demo_user[]=(object)array(second = 2);
$demo_user[]=(object)array(third = 3);

echo pre; var_dump($demo_user); echo /pre;

?

 This doesnt trigger any error message here



[2009-09-09 10:07:50] neofutur dot php at ww7 dot be

your bugtool dont accept my comment after 40 attempts, so I just post
the pastebin url containing all my comments and logs :

http://dpaste.com/91360/



[2009-09-09 09:56:15] joeysmith at gmail dot com

Sorry for the noise - testing the assertion that CAPTCHAs are broken.



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/44872

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



#44872 [NoF-Csd]: canary mismatch on efree() - heap overflow detected

2010-02-09 Thread pajoye
 ID:   44872
 Updated by:   paj...@php.net
 Reported By:  mattr at shoplet dot com
-Status:   No Feedback
+Status:   Closed
 Bug Type: MySQLi related
 Operating System: FreeBSD 6.2
 PHP Version:  5.2.5


Previous Comments:


[2010-02-09 13:22:22] jimmy at pixelant dot se

Feb  9 13:51:36 xx suhosin[4498]: ALERT - canary mismatch
on efree() - heap overflow detected (attacker 'x.x.x.x', file
'class.t3lib_htmlmail.php', line 718)


Upgrade to php 5.2.12 resolved this issue.



[2009-09-09 20:51:05] squarious at gmail dot com

I have the same error on 5.2.10 with suhosin patch.
Linux 2.6.31-10-generic #30-Ubuntu SMP Tue Sep 8 12:32:38 UTC 2009
x86_64 GNU/Linux

The tested site was working perfectly on Ubuntu 8.04 LTS with untouched
PHP 5.2.4 (with suhosin patch). The behaviour however is not standard
and it depends if the page is first time visite



[2009-09-09 12:03:27] neofutur dot php at ww7 dot be

update/workaround . . . but scary . . .

 someone on ##php tols me to restart apache, that when you get one of 
those canary mismatch on efree() you get many until you restart apache.
 I didnt pay attention at the beginning but finally tried it.

 Its simply true, when you get those messages , restart apache and you
will see no more of them ( until the next apache overflow ? )



[2009-09-09 10:21:49] neofutur dot php at ww7 dot be

I also tried the code suggested :

?php
$demo_user[]=(object)array(first = 1);
$demo_user[]=(object)array(second = 2);
$demo_user[]=(object)array(third = 3);

echo pre; var_dump($demo_user); echo /pre;

?

 This doesnt trigger any error message here



[2009-09-09 10:07:50] neofutur dot php at ww7 dot be

your bugtool dont accept my comment after 40 attempts, so I just post
the pastebin url containing all my comments and logs :

http://dpaste.com/91360/



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/44872

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



#50973 [NEW]: DOMDocument::saveHTML() should be able to take a node as an arg

2010-02-09 Thread geoffers+phpbugs at gmail dot com
From: geoffers+phpbugs at gmail dot com
Operating system: N/A
PHP version:  5.3SVN-2010-02-09 (SVN)
PHP Bug Type: DOM XML related
Bug description:  DOMDocument::saveHTML() should be able to take a node as an 
arg

Description:

At the moment DOMDocument::save() and DOMDocument::saveXML() both take an
optional first argument which is a node to serialize;
DOMDocument::saveHTML() and DOMDocument::saveHTMLFile() have no such option
and always serialize the whole file. For cases where HTML serialization is
needed of a specific node, all that can be done is doing it within PHP code
(which is comparatively very slow). As libxml includes the needed APIs to
do this, it doesn't appear to be overly complex to implement. I'll try to
write a patch for this later.


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



#50975 [NEW]: Floating point match Failure

2010-02-09 Thread dmgx dot michael at gmail dot com
From: dmgx dot michael at gmail dot com
Operating system: Windows  Linux
PHP version:  5.3.1
PHP Bug Type: *Math Functions
Bug description:  Floating point match Failure

Description:

What is 34.2 - 33.98? I don't think the answer needs 15 digits.

Reproduce code:
---
?php echo 34.2 - 33.98 ?

Expected result:

0.22

Actual result:
--
0.220001

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



#50975 [Opn-Bgs]: Floating point match Failure

2010-02-09 Thread rasmus
 ID:   50975
 Updated by:   ras...@php.net
 Reported By:  dmgx dot michael at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: *Math Functions
 Operating System: Windows  Linux
 PHP Version:  5.3.1
 New Comment:

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about floats and what IEEE
754 is, read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.

.


Previous Comments:


[2010-02-09 16:43:00] dmgx dot michael at gmail dot com

Description:

What is 34.2 - 33.98? I don't think the answer needs 15 digits.

Reproduce code:
---
?php echo 34.2 - 33.98 ?

Expected result:

0.22

Actual result:
--
0.220001





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



#50976 [NEW]: Soap headers Authorization not allowed

2010-02-09 Thread bfra...@php.net
From: bfra...@php.net
Operating system: 
PHP version:  5.3.1
PHP Bug Type: SOAP related
Bug description:  Soap headers Authorization not allowed

Description:

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/ext/soap/php_http.c?r1=266886r2=266885pathrev=266886

This patch adds support to add headers into the http context, but doesn't
allow the Authorization header for some reason.

I added a patch to our 5.2 build that would add all headers in the http
context and remove that patch in 5.3 because I noticed the above patch. 
Somebody at work is needing to add Authorization header to get OAuth stuff
working, but for some reason it is not allowed.

Here is a patch that will allow the Authorization header:

http://www.brianfrance.com/software/php/soap_http_headers/soap_http_headers.diff

Reproduce code:
---
Here is an example script that requires the Authorization when used for
the OAuth stuff.

http://www.brianfrance.com/software/php/soap_http_headers/oauthsoapsample.php.txt


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



#50977 [NEW]: imap_headerinfo Address buffer overflow

2010-02-09 Thread lokitek at gmail dot com
From: lokitek at gmail dot com
Operating system: CentOS 5.4
PHP version:  5.2.12
PHP Bug Type: Reproducible crash
Bug description:  imap_headerinfo Address buffer overflow

Description:

While using the imap_headerinfo() function to obtain information about
emails that I check via IMAP, I noticed that PHP complained about
imap_headerinfo() Address buffer overflow.
A bit of investigation revealed that a spam message containing 500+ CC
email addresses caused this issue.

Reproduce code:
---
// Send an email with 500+ CCd users. then use imap_headerinfo() to //
obtain all header information.
// [from doc]
$mBox = imap_open({host:143/imap/novalidate-cert}INBOX}, $username,
$password); // open as imap
$header = imap_header($mBox, 1); // get first mails header

// imap_headerinfo() will crash with the following error:
// PHP Fatal error:  imap_headerinfo(): Address buffer overflow



Expected result:

I expect to information about the given message number by reading its
headers and returned in an object format

Actual result:
--
PHP Fatal error:  imap_headerinfo(): Address buffer overflow

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



#50977 [Opn-Fbk]: imap_headerinfo Address buffer overflow

2010-02-09 Thread pajoye
 ID:   50977
 Updated by:   paj...@php.net
 Reported By:  lokitek at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: CentOS 5.4
 PHP Version:  5.2.12
 New Comment:

Which imap version do you use?


Previous Comments:


[2010-02-09 19:00:23] lokitek at gmail dot com

Description:

While using the imap_headerinfo() function to obtain information about
emails that I check via IMAP, I noticed that PHP complained about
imap_headerinfo() Address buffer overflow.
A bit of investigation revealed that a spam message containing 500+ CC
email addresses caused this issue.

Reproduce code:
---
// Send an email with 500+ CCd users. then use imap_headerinfo() to //
obtain all header information.
// [from doc]
$mBox = imap_open({host:143/imap/novalidate-cert}INBOX}, $username,
$password); // open as imap
$header = imap_header($mBox, 1); // get first mails header

// imap_headerinfo() will crash with the following error:
// PHP Fatal error:  imap_headerinfo(): Address buffer overflow



Expected result:

I expect to information about the given message number by reading its
headers and returned in an object format

Actual result:
--
PHP Fatal error:  imap_headerinfo(): Address buffer overflow





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



#50978 [NEW]: OciFetchStatement

2010-02-09 Thread atila at nutroeste dot com dot br
From: atila at nutroeste dot com dot br
Operating system: RHEL 5.2 64 BITS
PHP version:  5.2.12
PHP Bug Type: OCI8 related
Bug description:   OciFetchStatement

Description:

Dears,

The function is  OciFetchStatement.

Since I have more than 2 times the same problem, and the task to
resolve this was to hard. I have to report that every time I use a complex
sql using operator union or union all, the return message is

Notice: Undefined offset: 0 in
/usr/local/apache/html/pedidos/teste_union.php on line 19
numero de linhas:

As you can see the Undefined offset: 0 means that there is no record
to be retrived from a query, but if I run this same query using my database
tool, a result could be seen.

To resolve this I had to create temporary tables to insert the
data into it's own structure using my sql union/union all query to became
only one table and force the OciFetchStatement to retrive the results I
wanted.   
My database is Oracle 10.2.04 running on Linux rhel 5.2 64bits.
My php version is source 5.2.9 running in the same host.

Thanks an advance

Atila Santos
mail: at...@nutroeste.com.br
Country Brazil
State Goias, city: Goiania
+5562-30962539/2500
System Analist/Dba Oracle/Web Developer 

Reproduce code:
---
Notice: Undefined offset: 0 in
/usr/local/apache/html/pedidos/teste_union.php on line 19

Expected result:

The result should bring me up values of rows.


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



#50979 [NEW]: FastCGI/CGI runtime selection error

2010-02-09 Thread php at linepoint dot com
From: php at linepoint dot com
Operating system: Freebsd
PHP version:  5.3.1
PHP Bug Type: CGI related
Bug description:  FastCGI/CGI runtime selection error

Description:

PHP v5.3+ now forces fastcgi support to be compiled into the executable,
and upon execution of php-cgi, auto selects which mode (fastcgi/cgi) is to
be used.

In some circumstances, it can guess incorrectly and use fastcgi mode when
cgi mode should be used.

PHP's method of checking in sapi/cgi/fastcgi.c (line ~230) uses the errno
returned (ENOTCONN) as an assumption that a local/unix socket connection
must be a fastcgi call.

A alternative or secondary check should be implemented to verify that it's
truly a fastcgi execution.

This problem was initially found when working with the Zeus Webserver
(http://www.zeus.com), but can be reproduced with other systems that work
the same way.

Reproduce code:
---
When php-cgi is called from a webserver, it checks stdin (fd 0) with a
getpeername call to see if it's reading via a socket or not.  In some
circumstances/webservers, php-cgi can be called using local sockets instead
of file, but not be executed with fastcgi hooks.

Code in question:
--- sapi/cgi/fastcgi.c.orig 2010-02-09 12:25:49.0 -0500
}
 #else
errno = 0;
if (getpeername(0, (struct sockaddr *)sa, len) != 0 
errno == ENOTCONN) {
fcgi_setup_signals();
return is_fastcgi = 1;
} else {

---



Expected result:

Expected result is that fastcgi mode is used for fastcgi calls, and cgi
mode is used for cgi calls.

A proof of concept patch which fixes the issue (this is not a final
patch due to the fact the environmental variable checked is optional, not
mandatory)

--- sapi/cgi/fastcgi.c.orig 2010-02-09 12:25:49.0 -0500
+++ sapi/cgi/fastcgi.c  2010-02-09 12:26:50.0 -0500
@@ -228,7 +228,7 @@
}
 #else
errno = 0;
-   if (getpeername(0, (struct sockaddr *)sa, len) != 0 
errno == ENOTCONN) {
+   if (getpeername(0, (struct sockaddr *)sa, len) != 0 
errno == ENOTCONN  getenv (PHP_FCGI_CHILDREN) ) {
fcgi_setup_signals();
return is_fastcgi = 1;
} else {


Actual result:
--
The current code auto selects fastcgi mode, when cgi mode is the desired
result.

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



#50978 [Opn-Fbk]: OciFetchStatement

2010-02-09 Thread johannes
 ID:   50978
 Updated by:   johan...@php.net
 Reported By:  atila at nutroeste dot com dot br
-Status:   Open
+Status:   Feedback
 Bug Type: OCI8 related
 Operating System: RHEL 5.2 64 BITS
 PHP Version:  5.2.12
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:


[2010-02-09 20:13:21] atila at nutroeste dot com dot br

Description:

Dears,

The function is  OciFetchStatement.

Since I have more than 2 times the same problem, and the task to
resolve this was to hard. I have to report that every time I use a
complex sql using operator union or union all, the return message is

Notice: Undefined offset: 0 in
/usr/local/apache/html/pedidos/teste_union.php on line 19
numero de linhas:

As you can see the Undefined offset: 0 means that there is no
record to be retrived from a query, but if I run this same query using
my database tool, a result could be seen.

To resolve this I had to create temporary tables to insert the
data into it's own structure using my sql union/union all query to
became only one table and force the OciFetchStatement to retrive the
results I wanted.   
My database is Oracle 10.2.04 running on Linux rhel 5.2 64bits.
My php version is source 5.2.9 running in the same host.

Thanks an advance

Atila Santos
mail: at...@nutroeste.com.br
Country Brazil
State Goias, city: Goiania
+5562-30962539/2500
System Analist/Dba Oracle/Web Developer 

Reproduce code:
---
Notice: Undefined offset: 0 in
/usr/local/apache/html/pedidos/teste_union.php on line 19

Expected result:

The result should bring me up values of rows.






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



#50979 [Opn-Asn]: FastCGI/CGI runtime selection error

2010-02-09 Thread johannes
 ID:   50979
 Updated by:   johan...@php.net
 Reported By:  php at linepoint dot com
-Status:   Open
+Status:   Assigned
 Bug Type: CGI related
 Operating System: Freebsd
 PHP Version:  5.3.1
-Assigned To:  
+Assigned To:  dmitry


Previous Comments:


[2010-02-09 20:53:47] php at linepoint dot com

Description:

PHP v5.3+ now forces fastcgi support to be compiled into the
executable, and upon execution of php-cgi, auto selects which mode
(fastcgi/cgi) is to be used.

In some circumstances, it can guess incorrectly and use fastcgi mode
when cgi mode should be used.

PHP's method of checking in sapi/cgi/fastcgi.c (line ~230) uses the
errno returned (ENOTCONN) as an assumption that a local/unix socket
connection must be a fastcgi call.

A alternative or secondary check should be implemented to verify that
it's truly a fastcgi execution.

This problem was initially found when working with the Zeus Webserver
(http://www.zeus.com), but can be reproduced with other systems that
work the same way.

Reproduce code:
---
When php-cgi is called from a webserver, it checks stdin (fd 0) with a
getpeername call to see if it's reading via a socket or not.  In some
circumstances/webservers, php-cgi can be called using local sockets
instead of file, but not be executed with fastcgi hooks.

Code in question:
--- sapi/cgi/fastcgi.c.orig 2010-02-09 12:25:49.0 -0500
}
 #else
errno = 0;
if (getpeername(0, (struct sockaddr *)sa, len) != 0
 errno == ENOTCONN) {
fcgi_setup_signals();
return is_fastcgi = 1;
} else {

---



Expected result:

Expected result is that fastcgi mode is used for fastcgi calls, and cgi
mode is used for cgi calls.

A proof of concept patch which fixes the issue (this is not a final
patch due to the fact the environmental variable checked is optional,
not mandatory)

--- sapi/cgi/fastcgi.c.orig 2010-02-09 12:25:49.0 -0500
+++ sapi/cgi/fastcgi.c  2010-02-09 12:26:50.0 -0500
@@ -228,7 +228,7 @@
}
 #else
errno = 0;
-   if (getpeername(0, (struct sockaddr *)sa, len) != 0
 errno == ENOTCONN) {
+   if (getpeername(0, (struct sockaddr *)sa, len) != 0
 errno == ENOTCONN  getenv (PHP_FCGI_CHILDREN) ) {
fcgi_setup_signals();
return is_fastcgi = 1;
} else {


Actual result:
--
The current code auto selects fastcgi mode, when cgi mode is the
desired result.





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



#50753 [Asn-Csd]: crypt_sha256.c / crypt_sha512.c - Gnu specific code, non-Gnu compiler

2010-02-09 Thread johannes
 ID:   50753
 Updated by:   johan...@php.net
 Reported By:  yatessc at telkom dot co dot za
-Status:   Assigned
+Status:   Closed
 Bug Type: Compile Failure
 Operating System: Solaris 9 Sparc
 PHP Version:  5.3.2RC1
 Assigned To:  dsp
 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:


[2010-02-09 21:58:14] s...@php.net

Automatic comment from SVN on behalf of johannes
Revision: http://svn.php.net/viewvc/?view=revisionrevision=294825
Log: Detect if we can rely on compiler-specific alignment features else
use custom
workarounds. Fixes #50753



[2010-01-14 15:33:42] johan...@php.net

Related to #50496.

David, as you expected the other C99 types create some trouble, too :-/



[2010-01-14 15:22:03] yatessc at telkom dot co dot za

Description:

Using Sun ONE Studio 8 cc compiler on Solaris 9 Sparc.
Compilation of ext/standard/crypt_sha512.c fails with:
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 376:
syntax error before or at: __attribute__
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 377:
invalid type combination
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 378:
syntax error before or at: __attribute__
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 380:
invalid type combination
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 416:
warning: implicit function declaration: __alignof__
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 416:
syntax error before or at: uint64_t
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 419:
undefined symbol: tmp
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 419:
syntax error before or at: uint64_t
/usr/local/php5.3-201001130730/ext/standard/crypt_sha512.c, line 420:
cannot recover from previous errors

ext/standard/crypt_sha256.c also fails with similar errors,
just different line numbers.

I believe that __attribute__ and __alignof__ are Gnu specific
extensions, although __alignof__ has been adopted by some other 
compilers (e.g. Sun Studio, but only from Release 12 onwards).

The problem still exists with yesterday's snapshot
(php5.3-201001130730.tar.gz).






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



#50980 [NEW]: lambda/anonymous functions do not have proper scope

2010-02-09 Thread nate at frickenate dot com
From: nate at frickenate dot com
Operating system: Linux
PHP version:  5.3.1
PHP Bug Type: Unknown/Other Function
Bug description:  lambda/anonymous functions do not have proper scope

Description:

The way in which variables are passed to the inside of a lambda function
via the 'use (...)' syntax is broken. The entire concept of scope or
closures does not seem to apply in php whatsoever.

Variables within a lambda are supposed to be resolved/looked up in the
parent scope at runtime when the variable is actually accessed within the
lambda function's code. It seems that php just dumbly creates a copy of the
variable when it sees the definition of the lambda function with the 'use
(...)' clause. Changes to the variable in the parent scope between the
moment where the lambda is defined and the lambda function is called are
not propagated.

The worst part happens with objects. When passing in an object instance to
a lambda, any changes to the original object in the parent scope after the
lambda definition do affect the same object (problem 4 in reproduce code),
but replacing the object altogether does not (problem 3 in reproduce code).
I imagine this has to do with the php5 fake references that are used to
pass objects around.

I get the feeling this is just a horrible limitation of the devs having
hacked a best-possible implementation of lambdas into a Zend codebase
that can't handle proper scope lookup. If this is the case, it would be
nice if the documentation could be updated to really nail home the fact
that there is no scoping going on at all, and that quite literally all you
get is a copy of the variable as it exists at the moment the lambda is
defined (except for the strangeness going on with objects).

It's unfortunate that the solution for the time being is to *always*
pass in *every* variable as a reference, which results in expected output.
But this requires creating a local copy within the lambda for every
variable that one wants to modify without affecting the parent scope. :'(

Reproduce code:
---
?php

// problem 1: this should echo Canada, not a php notice
$fn = function () use ($country) { echo $country . \n; };
$country = 'Canada';
$fn();


// problem 2: this should echo Canada, not UnitedStates
$country = 'UnitedStates';
$fn = function () use ($country) { echo $country . \n; };
$country = 'Canada';
$fn();


// problem 3: this should echo Canada, not UnitedStates
$country = (object)array('name' = 'UnitedStates');
$fn = function () use ($country) { echo $country-name . \n; };
$country = (object)array('name' = 'Canada');
$fn();


// problem 4: this outputs Canada. if this outputs Canada,
// then so should problem 2 above. otherwise this should be
// just as broken as problem 2 and be outputting UnitedStates
$country = (object)array('name' = 'UnitedStates');
$fn = function () use ($country) { echo $country-name . \n; };
$country-name = 'Canada';
$fn();

?

Expected result:

If scope was actually handled properly, then the lookup of the use
(...)'d variable would occur at the moment the variable is used within the
lambda, resulting in the following output:

Canada
Canada
Canada
Canada

Actual result:
--
PHP Notice:  Undefined variable: country in ... on line 5

UnitedStates
UnitedStates
Canada

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

#50981 [NEW]: CachingIterator::hasNext() does not return correct value in some cases

2010-02-09 Thread clarity1285 at gmail dot com
From: clarity1285 at gmail dot com
Operating system: Mac OS X
PHP version:  5.3.1
PHP Bug Type: SPL related
Bug description:  CachingIterator::hasNext() does not return correct value in 
some cases

Description:

When there are 11 total items and you use a LimitIterator to get the 
first 10, CachingIterator::hasNext() returns false even though there are 
more than 10 items in the initial set.

If there are 12 total items it works as expected.

Reproduce code:
---
$items = new ArrayObject(range(1,11));

echo 'there are ' . $items-count() . ' total items' . \r\n;

$cachingIterator = new CachingIterator($items-getIterator());

$limitIterator = new LimitIterator($cachingIterator, 0, 10);

$i = 0;
foreach ($limitIterator as $item) {
++$i;
}

echo 'first page has ' . $i . ' items' . \r\n;

if ($cachingIterator-hasNext()) {
echo 'there is a next page';
} else {
echo 'there is no next page';
}

Expected result:

The code should output:

there are 11 total items 
first page has 10 items 
there is a next page

Actual result:
--
The code outputs:

there are 11 total items 
first page has 10 items 
there is no next page

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



#50982 [NEW]: incorrect assumption of PAGE_SIZE size

2010-02-09 Thread geissert at debian dot org
From: geissert at debian dot org
Operating system: 
PHP version:  5.3.1
PHP Bug Type: *Compile Issues
Bug description:  incorrect assumption of PAGE_SIZE size

Description:

If sys/mman.h does not define PAGE_SIZE there's an incorrect assumption
that it is 4096. This can have multiple side effects.

At Debian we are going to use the following patch:
http://git.debian.org/?p=pkg-php/php.git;a=blob;f=debian/patches/page_size_fixes.patch;h=f24b732ff6349101e1cee560b581081ca74d717f;hb=HEAD

There's also a logical bug where PAGE_SIZE could not be defined at all but
still used, but I'm not addressing that one.



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



#49820 [Com]: XSLTProcessor returns Error at xsl:variable with comment inside

2010-02-09 Thread wellnhofer at aevum dot de
 ID:   49820
 Comment by:   wellnhofer at aevum dot de
 Reported By:  felixsigl at gmail dot com
 Status:   Open
 Bug Type: XSLT related
 Operating System: Windows
 PHP Version:  5.3.0
 New Comment:

The second example without whitespace is a bug in libxslt. It's a
pretty minor issue, but maybe I'll fix it in libxslt.

Nick


Previous Comments:


[2009-10-10 14:15:14] felixsigl at gmail dot com

Hi, 

i have tried:

xsl:variable select=1 name=var!--comment--/xsl:variable

thus no whitspace

but the same error: XSLT-variable: The must be no child nodes, since
the attribute 'select' was specified.



[2009-10-10 11:54:46] sjo...@php.net

Thank you for your bug report.

Can you also reproduce it if you remove the whitespace between the
variable tags? In your example, the variable element would have a text
child node with some whitespace in it. Technically, this is not allowed
since the variable tag should have no content at all.



[2009-10-09 13:03:40] felixsigl at gmail dot com

Description:

I have a lot of XSL files which i want to process with the libxml
XSLTProcessor. But the XSLTProcessor returns Error at xsl:variable with
a comment inside. I don´t know exactly if this is a bug but i think so.

I know that i should use either a select attribute or child nodes in
the variable to define the variable. but shouldn´t comments be ignored
in that way?

Reproduce code:
---
the variable in the xsl file:

doesnt work!:
xsl:variable select=1 name=var 
   !-- comment --
/xsl:variable

works:
xsl:variable select=1 name=var /

works too:
xsl:variable name=var 
   !-- comment --
/xsl:variable

Expected result:

transformed XML

Actual result:
--
Error 1: compilation error: file file:///C:/Programme/xampp/test01.xsl
line 4 element variable Line: 0 Column: 0 Error 1: XSLT-variable: The
must be no child nodes, since the attribute 'select' was specified.
Line: 0 Column: 0





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



#50977 [Com]: imap_headerinfo Address buffer overflow

2010-02-09 Thread lokitek at gmail dot com
 ID:   50977
 Comment by:   lokitek at gmail dot com
 Reported By:  lokitek at gmail dot com
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: CentOS 5.4
 PHP Version:  5.2.12
 New Comment:

I don't think that it makes a huge difference, but I just realized that
I'm on php-5.2.11 and using php-imap-5.2.11

If this isn't what you're after, just let me know and I can do a bit of
debugging all around.

Thanks!


Previous Comments:


[2010-02-09 19:06:57] paj...@php.net

Which imap version do you use?



[2010-02-09 19:00:23] lokitek at gmail dot com

Description:

While using the imap_headerinfo() function to obtain information about
emails that I check via IMAP, I noticed that PHP complained about
imap_headerinfo() Address buffer overflow.
A bit of investigation revealed that a spam message containing 500+ CC
email addresses caused this issue.

Reproduce code:
---
// Send an email with 500+ CCd users. then use imap_headerinfo() to //
obtain all header information.
// [from doc]
$mBox = imap_open({host:143/imap/novalidate-cert}INBOX}, $username,
$password); // open as imap
$header = imap_header($mBox, 1); // get first mails header

// imap_headerinfo() will crash with the following error:
// PHP Fatal error:  imap_headerinfo(): Address buffer overflow



Expected result:

I expect to information about the given message number by reading its
headers and returned in an object format

Actual result:
--
PHP Fatal error:  imap_headerinfo(): Address buffer overflow





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



#50977 [Fbk]: imap_headerinfo Address buffer overflow

2010-02-09 Thread pajoye
 ID:   50977
 Updated by:   paj...@php.net
 Reported By:  lokitek at gmail dot com
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: CentOS 5.4
 PHP Version:  5.2.12
 New Comment:

I'm not asking which PHP version you use (try 5.2.12, instead of
5.2.11) but which c-client library you use. c-client is the imap library
used by the php imap extension.


Previous Comments:


[2010-02-10 00:12:41] lokitek at gmail dot com

I don't think that it makes a huge difference, but I just realized that
I'm on php-5.2.11 and using php-imap-5.2.11

If this isn't what you're after, just let me know and I can do a bit of
debugging all around.

Thanks!



[2010-02-09 19:06:57] paj...@php.net

Which imap version do you use?



[2010-02-09 19:00:23] lokitek at gmail dot com

Description:

While using the imap_headerinfo() function to obtain information about
emails that I check via IMAP, I noticed that PHP complained about
imap_headerinfo() Address buffer overflow.
A bit of investigation revealed that a spam message containing 500+ CC
email addresses caused this issue.

Reproduce code:
---
// Send an email with 500+ CCd users. then use imap_headerinfo() to //
obtain all header information.
// [from doc]
$mBox = imap_open({host:143/imap/novalidate-cert}INBOX}, $username,
$password); // open as imap
$header = imap_header($mBox, 1); // get first mails header

// imap_headerinfo() will crash with the following error:
// PHP Fatal error:  imap_headerinfo(): Address buffer overflow



Expected result:

I expect to information about the given message number by reading its
headers and returned in an object format

Actual result:
--
PHP Fatal error:  imap_headerinfo(): Address buffer overflow





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



#49820 [Com]: XSLTProcessor returns Error at xsl:variable with comment inside

2010-02-09 Thread wellnhofer at aevum dot de
 ID:   49820
 Comment by:   wellnhofer at aevum dot de
 Reported By:  felixsigl at gmail dot com
 Status:   Open
 Bug Type: XSLT related
 Operating System: Windows
 PHP Version:  5.3.0
 New Comment:

I had a deeper look at the XSLT spec and it seems the both cases are
bugs in libxslt.


Previous Comments:


[2010-02-09 23:50:22] wellnhofer at aevum dot de

The second example without whitespace is a bug in libxslt. It's a
pretty minor issue, but maybe I'll fix it in libxslt.

Nick



[2009-10-10 14:15:14] felixsigl at gmail dot com

Hi, 

i have tried:

xsl:variable select=1 name=var!--comment--/xsl:variable

thus no whitspace

but the same error: XSLT-variable: The must be no child nodes, since
the attribute 'select' was specified.



[2009-10-10 11:54:46] sjo...@php.net

Thank you for your bug report.

Can you also reproduce it if you remove the whitespace between the
variable tags? In your example, the variable element would have a text
child node with some whitespace in it. Technically, this is not allowed
since the variable tag should have no content at all.



[2009-10-09 13:03:40] felixsigl at gmail dot com

Description:

I have a lot of XSL files which i want to process with the libxml
XSLTProcessor. But the XSLTProcessor returns Error at xsl:variable with
a comment inside. I don´t know exactly if this is a bug but i think so.

I know that i should use either a select attribute or child nodes in
the variable to define the variable. but shouldn´t comments be ignored
in that way?

Reproduce code:
---
the variable in the xsl file:

doesnt work!:
xsl:variable select=1 name=var 
   !-- comment --
/xsl:variable

works:
xsl:variable select=1 name=var /

works too:
xsl:variable name=var 
   !-- comment --
/xsl:variable

Expected result:

transformed XML

Actual result:
--
Error 1: compilation error: file file:///C:/Programme/xampp/test01.xsl
line 4 element variable Line: 0 Column: 0 Error 1: XSLT-variable: The
must be no child nodes, since the attribute 'select' was specified.
Line: 0 Column: 0





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



#50970 [Com]: force convert a string into int using (int) or intval() cause value truncate

2010-02-09 Thread zhangsilly at gmail dot com
 ID:   50970
 Comment by:   zhangsilly at gmail dot com
 Reported By:  zhangsilly at gmail dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  5.2.12
 New Comment:

this is cause by strtol, used in the ZEND_API convert_to_long_base(zval

*op, int base), which is defined in stdlib.h.

strtol will always return LONG_MAX if the string stands for a
number 
which is larger than LONG_MAX.

I'am afraid no matter zend_parse_parameters and convert_to_long,
the  
should have the same behavior.

This whill cause a situation that when i pass a string which is 
readed from file or socket to long2ip, long2ip($str) is right but 
long2ip((int)$str) will be failed.


Previous Comments:


[2010-02-09 01:29:31] zhangsilly at gmail dot com

Description:

use (int) or intval() to convert a string into integer in userland, if

bigger than 2147483647, this will result a truncate, the value will 
always be 2147483647.

 but use zend_parse_parameters to parse the string as a long 
arguement, is do give the correct value in nagtive format



Reproduce code:
---
/** 
* assert failure 
* (int)3740925952 result is -554041344 
* (int)'3740925952' result is 2147483647 
*/ 
assert((int)3740925952 == (int)'3740925952'); 

Expected result:

assert should be succeed

Actual result:
--
assert failure





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



#49820 [Com]: XSLTProcessor returns Error at xsl:variable with comment inside

2010-02-09 Thread wellnhofer at aevum dot de
 ID:   49820
 Comment by:   wellnhofer at aevum dot de
 Reported By:  felixsigl at gmail dot com
 Status:   Open
 Bug Type: XSLT related
 Operating System: Windows
 PHP Version:  5.3.0
 New Comment:

The following commit fixes this bug in libxslt

http://github.com/nwellnhof/libxslt/commit/a73df1cbb57f0e250b9815c6b8ed72bd52cb4f72


Previous Comments:


[2010-02-10 01:04:24] wellnhofer at aevum dot de

I had a deeper look at the XSLT spec and it seems the both cases are
bugs in libxslt.



[2010-02-09 23:50:22] wellnhofer at aevum dot de

The second example without whitespace is a bug in libxslt. It's a
pretty minor issue, but maybe I'll fix it in libxslt.

Nick



[2009-10-10 14:15:14] felixsigl at gmail dot com

Hi, 

i have tried:

xsl:variable select=1 name=var!--comment--/xsl:variable

thus no whitspace

but the same error: XSLT-variable: The must be no child nodes, since
the attribute 'select' was specified.



[2009-10-10 11:54:46] sjo...@php.net

Thank you for your bug report.

Can you also reproduce it if you remove the whitespace between the
variable tags? In your example, the variable element would have a text
child node with some whitespace in it. Technically, this is not allowed
since the variable tag should have no content at all.



[2009-10-09 13:03:40] felixsigl at gmail dot com

Description:

I have a lot of XSL files which i want to process with the libxml
XSLTProcessor. But the XSLTProcessor returns Error at xsl:variable with
a comment inside. I don´t know exactly if this is a bug but i think so.

I know that i should use either a select attribute or child nodes in
the variable to define the variable. but shouldn´t comments be ignored
in that way?

Reproduce code:
---
the variable in the xsl file:

doesnt work!:
xsl:variable select=1 name=var 
   !-- comment --
/xsl:variable

works:
xsl:variable select=1 name=var /

works too:
xsl:variable name=var 
   !-- comment --
/xsl:variable

Expected result:

transformed XML

Actual result:
--
Error 1: compilation error: file file:///C:/Programme/xampp/test01.xsl
line 4 element variable Line: 0 Column: 0 Error 1: XSLT-variable: The
must be no child nodes, since the attribute 'select' was specified.
Line: 0 Column: 0





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



#50986 [NEW]: using swf object the flv extension videos not playing

2010-02-09 Thread bhupinder1045 at gmail dot com
From: bhupinder1045 at gmail dot com
Operating system: Vista
PHP version:  5.3.1
PHP Bug Type: *PDF functions
Bug description:  using swf object the flv extension videos not playing

Description:

 script type=text/javascript
src=../flashplayer/swfobject.js/script
  div id=flashplayer/div 
  div id=container style=padding-left:4px/div
  script type=text/javascript
  
  
var file  = ?php echo $videoName!='' ? $videoName : 
''; ?; // for
uploaded file name.
//var utube = ?php echo $youLink!='' ? $youLink : ''; 
?; // for
utube link..
alert(file)

   var s1 = new
swf(../flashplayer/mediaplayer.swf,mediaplayer,500,320,8);


//var s1 = new
SWFObject(../flashplayer/mediaplayer.swf,mediaplayer,500,320,8);



s1.addParam(allowfullscreen,true);
s1.addVariable(width,500);
s1.addVariable(height,320);

s1.addVariable(autostart,false); // 'true' terurn 
auto run
s1.addVariable(repeat,true); // 'true' terurn auto 
run

   s1.addVariable(autoPlay, no);
  // s1.addVariable(soundPath, ?php echo
VIDEO_PATH.$getVideo['video_filename']; ?);
   //s1.write(flashplayer);


alert(file)
//  if(utube == '')
s1.addVariable(file,file);
//  else
//  s1.addVariable(file,utube);
s1.write(container);
/script

Reproduce code:
---
---
From manual page: function.swf-actionplay#Description
---



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



#50987 [NEW]: unaligned memory access in phar.c

2010-02-09 Thread geissert at debian dot org
From: geissert at debian dot org
Operating system: linux ia64
PHP version:  5.3.1
PHP Bug Type: PHAR related
Bug description:  unaligned memory access in phar.c

Description:

There's an unaligned memory access in ext/phar/phar.c's phar_set_32
function.

The following patch fixes it:

--- php.orig/ext/phar/phar.c
+++ php/ext/phar/phar.c
@@ -2491,7 +2491,7 @@ static inline void phar_set_32(char *buf
*((buffer) + 1) = (unsigned char) (((var)  8)  0xFF);
*((buffer) + 0) = (unsigned char) ((var)  0xFF);
 #else
-   *(php_uint32 *)(buffer) = (php_uint32)(var);
+   memcpy(buffer, var, sizeof(var));
 #endif
 } /* }}} */



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



#50989 [NEW]: LIBXML_NOXMLDECL and xsl:output omit-xml-declaration

2010-02-09 Thread zachatwork at gmail dot com
From: zachatwork at gmail dot com
Operating system: Debian Linux 5.0.3
PHP version:  5.3.1
PHP Bug Type: Feature/Change Request
Bug description:  LIBXML_NOXMLDECL and xsl:output omit-xml-declaration

Description:

libxml defines a constant LIBXML_NOXMLDECL, however DOMDocument doesn't
currently honor this variable. It is an extremely useful/important feature
because XHTML with an XML declaration triggers quirks mode in IE6. 

Similarly, XSLTProcessor does not honor the omit-xml-declaration
attribute of the xsl:output element. 

It would be very useful if support for one or both of these items were
added. 


Reproduce code:
---
---
From manual page: libxml.constants
---

?php

print PHP_VERSION:  .PHP_VERSION.\n;
print LIBXML_VERSION:   .LIBXML_VERSION.\n;
print LIBXML_NOXMLDECL: .LIBXML_NOXMLDECL.\n;

$dom = new DomDocument();
$dom-loadXML(foo /);

# This should work but doesn't.

print DOMDocument doesn't honor LIBXML_NOXMLDECL:\n;
print $dom-saveXML(null,LIBXML_NOXMLDECL);

# This works, and will still work after the above is fixed.

print Forwards compatible workaround:\n;
$lines = explode(\n, $dom-saveXML(null, LIBXML_NOXMLDECL), 2);
if(!preg_match('/^\\?xml/', $lines[0]))
print $lines[0];
print $lines[1];

?


Expected result:

PHP_VERSION:  5.3.0
LIBXML_VERSION:   20703
LIBXML_NOXMLDECL: 2
DOMDocument doesn't honor LIBXML_NOXMLDECL:
foo/
Forwards compatible workaround:
foo/


Actual result:
--
PHP_VERSION:  5.3.0
LIBXML_VERSION:   20703
LIBXML_NOXMLDECL: 2
DOMDocument doesn't honor LIBXML_NOXMLDECL:
?xml version=1.0?
foo/
Forwards compatible workaround:
foo/


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