#48570 [NEW]: SubstitutionGroup in XML schema not supported

2009-06-16 Thread sjoerd-php at linuxonly dot nl
From: sjoerd-php at linuxonly dot nl
Operating system: Linux 2.6.28 Ubuntu 9.0.4
PHP version:  5.2.9
PHP Bug Type: SOAP related
Bug description:  SubstitutionGroup in XML schema not supported

Description:

Elements in a XML schema (XSD) may have a substitutionGroup attribute
which indicates that this element may be used instead of an other element.
When an element with a substitutionGroup is defined in the schema part of
the WSDL and the endpoint returns a substitution instead of the original
element, the SoapClient does not deserialize the XML and returns nothing. 

Reproduce code:
---
Part of WSDL:



MySoapMethod returns a originalElement.

Returned XML:

http://schemas.xmlsoap.org/soap/envelope/";>


bla



In PHP, call method and expect "bla" to be returned:
echo $client->MySoapMethod();

Expected result:

Because in the example substitutionElement can be used instead of
originalElement, I expect the contents of substitutionElement to be
returned if there is no originalElement.

Actual result:
--
An empty string is returned, if there is no originalElement.

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



#48606 [Com]: getimagesize() wery slow on NTFS

2009-06-23 Thread sjoerd-php at linuxonly dot nl
 ID:   48606
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  majstor_kontakt at yahoo dot co dot uk
 Status:   Open
 Bug Type: GetImageSize related
 Operating System: Windows XP
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

In your example, you pass an URL to getimagesize(). Retrieving the URL
from the server may introduce some delay, independent of getimagesize().
If it takes 1 second to get the file from the server, the given example
still takes 1 second even if getimagesize() is very fast.

Please provide an example which does not use an URL, or provide more
information to show that the delay is caused by getimagesize() and not
by network or webserver problems.


Previous Comments:


[2009-06-19 13:04:59] majstor_kontakt at yahoo dot co dot uk

Description:

Big problem with "getimagesize($someUrl)" if my image is on my local
NTFS partition (I use windows xp and PHP5.2.10).
Image is wery small but function need about 1 sec to get data. (On
Fat32 partition it is very fast).

Reproduce code:
---
$imgSize =
getimagesize('http://localhost/aukcije/img.domen.com/admin/time_picker_small.png');

Expected result:

It must be fast.

Actual result:
--
It take about 1 sec!





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



#48576 [Com]: Wrong error number returned by system, passthru functions

2009-06-23 Thread sjoerd-php at linuxonly dot nl
 ID:   48576
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  yolcoyama at gmail dot com
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: Linux ubo 2.6.28-11-generic
 PHP Version:  5.2.9
 New Comment:

Thank you for your bug report.

On my system, crontab returns 1, as shown by these commands:
crontab -l -u USER; echo $?

This thus means that PHP returns the correct exit status. Instead, the
system() system call behaves strangely. You can show this by compiling a
program which returns 1 in its main loop and call that program using
system(). It will return 256 as return status. Python documents this
somewhat better than the C++ system call:

[It will] return a tuple containing its pid and exit status indication:
a 16-bit number, whose low byte is the signal number that killed the
process, and whose high byte is the exit status (if the signal number is
zero); the high bit of the low byte is set if a core file was produced.


Previous Comments:


[2009-06-17 06:35:23] yolcoyama at gmail dot com

Description:

Trying to install crontab with PHP cli, system (and passthru) function
returned error-code of "1" with output "no crontab for USER" (USER
should be replaced with real system user to whom crontab should be
installed).

the code is:
$ php -r '$c="crontab -u USER -l";system($c,$status); printf("%s
(%d)\n",$c,$status);'

the output is:
no crontab for USER
crontab -u USER -l (1)

Since no crontab is been installed for the USER, the output was
expected, but I don't think error code should be 1 for this.

For comparison, python and c++ both returns 256 of error code for this
error ("no crontab for USER be installed").

According to an error code definition of unix system (in ubuntu,
/usr/include/asm-generic/errno-base.h and errno.h), 1 be translated as
"permission denied".

Followings are comparison code and result for other languages.
They returned error number 256 but PHP.

* c++
#include 
#include 
using namespace std;

int main(int argc,char *argv[]){
string cmnd("crontab -u USER -l");
int errcode=system(cmnd.data());
printf(
"%s (%d)\n",
cmnd.data(),
errcode
);
return 0;
}

r...@server2:~/diary# ./a.out
no crontab for USER
crontab -u USER -l (256)

* python
r...@server2:~/diary# python -c 'import os; c="crontab -u USER -l";
print "%s (%d)" % (c, os.system(c))'
no crontab for USER
crontab -u USER -l (256)

* php
r...@server2:~/diary# php -r '$c="crontab -u USER
-l";system($c,$status); printf("%s (%d)\n",$c,$status);'
no crontab for USER
crontab -u USER -l (1)

* error number refference
r...@server2:~/diary# awk '/[\x20\t]+1[\x20\t]+/'
/usr/include/asm-generic/errno-base.h
#define EPERM1  // Operation not permitted



Reproduce code:
---
# make sure there's NO crontab installed for USER.

$ php -r '$c="crontab -u USER -l";system($c,$status); printf("%s
(%d)\n",$c,$status);'


Expected result:

Output:
no crontab for USER
crontab -u USER -l (256)

Actual result:
--
Output:
no crontab for USER
crontab -u USER -l (1)





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



#48573 [Com]: E-notated strings improperly cast as integers

2009-06-23 Thread sjoerd-php at linuxonly dot nl
 ID:   48573
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  josh at mykoala dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Mac OS X 10.5.7
 PHP Version:  5.2.9
 New Comment:

Thank you for your bug report.

A workaround for what you want is adding 0:
php -r 'echo 0 + "5.6401418785e+05";'
564014.18785


Previous Comments:


[2009-06-16 19:54:37] josh at mykoala dot com

> When an E notated integer

When an E notated float*

intval() on the string also (predictably) produces the same result as
casting to int



[2009-06-16 19:08:10] josh at mykoala dot com

Description:

When an E notated integer is in a string, and you try to cast it to an
integer, the value stops at anything non-integer, reducing the ability
to cast notated numbers.  It does not first check or convert the value
to a float to account for E notation.

The documentation on type juggling doesn't mention this limitation, and
it is not the expected result.

Reproduce code:
---
$ php -r 'var_dump((int)"5.6401418785e+05");'
int(5)
$ php -r 'var_dump((int)5.6401418785e+05);'
int(564014)
$ php -r 'var_dump((int)(float)"5.6401418785e+05");'
int(564014)






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



#48559 [Com]: Object comparison using unserialized DateTime object causes segfault

2009-06-23 Thread sjoerd-php at linuxonly dot nl
 ID:   48559
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  fel...@php.net
 Status:   Open
 Bug Type: Date/time related
 Operating System: Linux
 PHP Version:  5.2CVS-2009-06-15 (CVS)
 New Comment:

Could reproduce on PHP 5.2.10 (cli), not on PHP 5.3.0RC4 (cli).


Previous Comments:


[2009-06-15 13:51:45] fel...@php.net

Description:

This issue just occurs on 5.2.

See the code below.

Reproduce code:
---
time->sse_uptodate) {
(gdb) bt
#0  0x080bed7a in date_object_compare_date (d1=0xa7a5308, d2=0xa7a5288,
tsrm_ls=0xa5802a8) at /home/felipe/dev/php5_2/ext/date/php_date.c:1581
#1  0x084e3773 in compare_function (result=0xbfc93f10, op1=0xa7a5308,
op2=0xa7a5288, tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_operators.c:1416
#2  0x084e404c in is_equal_function (result=0xbfc93f10, op1=0xa7a5308,
op2=0xa7a5288, tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_operators.c:1547
#3  0x0853b9f1 in ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER
(execute_data=0xbfc93f44, tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_vm_execute.h:11516
#4  0x085126e4 in execute (op_array=0xa7a5a10, tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_vm_execute.h:92
#5  0x084da6aa in zend_eval_string (str=0xbfc957dc
"unserialize(serialize(new datetime())) == new datetime;",
retval_ptr=0x0, 
string_name=0x87fb6dc "Command line code", tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_execute_API.c:1214
#6  0x084da8e2 in zend_eval_string_ex (str=0xbfc957dc
"unserialize(serialize(new datetime())) == new datetime;",
retval_ptr=0x0, 
string_name=0x87fb6dc "Command line code", handle_exceptions=1,
tsrm_ls=0xa5802a8) at
/home/felipe/dev/php5_2/Zend/zend_execute_API.c:1248
#7  0x08573484 in main (argc=3, argv=0xbfc94314) at
/home/felipe/dev/php5_2/sapi/cli/php_cli.c:1201






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



#48216 [Com]: PHP Fatal error: SOAP-ERROR: Parsing WSDL: Extra content at the end of the doc

2009-06-24 Thread sjoerd-php at linuxonly dot nl
 ID:   48216
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  mark at everytruckjob dot com
 Status:   Open
 Bug Type: SOAP related
 Operating System: CentOs 5.3
 PHP Version:  5.3.0RC2
 New Comment:

Thank you for your bug report.

The WSDL URL you supply does not send a Content-Length or
Transfer-Encoding header in some cases, which is mandatory in a response
with a body. In other words, it does not follow the HTTP protocol. You
should contact the provider of the WSDL about this.


GET /url HTTP/1.0
Host: example.com

HTTP/1.1 200 OK
Date: Wed, 24 Jun 2009 10:18:10 GMT
Server: Apache
Connection: close
Content-Type: text/xml

...


Previous Comments:


[2009-05-09 23:12:48] mark at everytruckjob dot com

Description:

Trying to set up a soapClient using the wsdl from the location found in
http://www.everytruckjob.com/php53-url.txt (this contains the url and is
not the wsdl file itself so I can remove the location once this report
is closed as it is not my soap server).

Copying the wsdl from the referenced location to my own
(http://www.everytruckjob.com/wsdl.php) or saving it to a local file
allows parsing to succeed, but while the file sizes seem to be the same,
I can't figure out what headers or content causes the "Extra content at
the end of the document" error.

This works as expected on php 5.2.9 compiled and in use on the same
client server with Centos 5.3 libxml2.x86_64 2.6.26-2.1.2.7.


Reproduce code:
---
http://www.everytruckjob.com/php53-url.txt'));  

try {
$a = new SoapClient($wsdl);
} catch (SoapFault $e) {
var_dump(libxml_get_last_error());
var_dump($e);
}
?>

Expected result:

No SoapFault

Actual result:
--
object(LibXMLError)#1 (6) { ["level"]=>  int(3) ["code"]=>  int(5)
["column"]=>  int(4) ["message"]=>  string(41) "Extra content at the end
of the document " ["file"]=>  string(55) "http://"; ["line"]=> 
int(488) } 

object(SoapFault)#2 (9) {
["message":protected]=>  string(146) "SOAP-ERROR: Parsing WSDL:
Couldn't load from 'X' : Extra content at the end of the document "







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



#46130 [Com]: SOAP-ERROR: Parsing WSDL

2009-06-24 Thread sjoerd-php at linuxonly dot nl
 ID:   46130
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  cfelce at gmail dot com
 Status:   Open
 Bug Type: SOAP related
 Operating System: GNU/Linux Ubuntu fesity
 PHP Version:  5.2CVS-2008-09-19 (CVS)
 New Comment:

Thank you for your bug report.

The message "Unknown required WSDL extension" means that the WSDL uses
some extension and specifies that the client MUST understand it in order
to use the service. Appearantly, PHP SoapClient does not understand the
extension, thus causing this error.

Please provide the WSDL or information about the required extension.


Previous Comments:


[2009-03-11 19:35:13] michael dot schramm at gmail dot com

Same thing happens with PHP version 5.2.6:

SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension
'http://schemas.xmlsoap.org/ws/2004/09/policy'

Changing the Service is not always an option!



[2008-12-31 11:12:18] omabil at gmail dot com

Hello everybody,
the work-around we used to avoid this problem is by using the standard
sap wsdl instead of the ws-policy one.
By replacing the "wspolicy" word by "standard" in the url of the wsdl
we've got a second wsdl which doesn't use the ws policies.
Regards,
--
Omabil



[2008-12-22 17:04:48] omabil at gmail dot com

Hello everybody,
someone has found some solution for this problem?
Thanks a lot,
--
Omabil



[2008-09-19 20:03:29] cfelce at gmail dot com

Description:

Hi experts, 

I'm having some issues loading a wsdl file of a sap webservice and 
the error comes as follows:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing 
WSDL: Unknown required WSDL extension 
'http://schemas.xmlsoap.org/ws/2004/09/policy' in /var/www/ws3.php:4 
Stack trace: #0 /var/www/ws3.php(4): SoapClient-
>SoapClient('zws_panda.wsdl', Array) #1 {main} thrown in 
/var/www/ws3.php on line 4




Reproduce code:
---
 "cfelce",
'password' => "XX", 'compression' => SOAP_COMPRESSION_ACCEPT |
SOAP_COMPRESSION_GZIP, 'encoding' => 'utf-8' ));

print($client->ZWsPanda("123456789"));


?>

Expected result:

Information about the client

Actual result:
--
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing 
WSDL: Unknown required WSDL extension 
'http://schemas.xmlsoap.org/ws/2004/09/policy' in /var/www/ws3.php:4 
Stack trace: #0 /var/www/ws3.php(4): SoapClient-
>SoapClient('zws_panda.wsdl', Array) #1 {main} thrown in 
/var/www/ws3.php on line 4





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



#48664 [Com]: crypt truncating salt values

2009-06-24 Thread sjoerd-php at linuxonly dot nl
 ID:   48664
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  patrickdk at patrickdk dot com
 Status:   Open
 Bug Type: Strings related
 Operating System: linux 2.6.x
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

In your example, you use a salt beginning with $6$, which tells crypt
to use SHA512. However, this usage is not described in the PHP manual.
It does not seem to work correctly in PHP 5.2 and is does not seem to
work at all in PHP 5.3. I think crypt() does not support SHA256 or
SHA512, since it does not work correctly and is not in the manual.

Of course, it would still be nice if crypt() supported this or gave a
decent error message.


Previous Comments:


[2009-06-23 16:23:58] patrickdk at patrickdk dot com

Description:

Salts passed to the crypt function are truncated to 12 char lengths.


Reproduce code:
---
echo
crypt('test','$6$abcdefghijklmno$tQbBMthtllLykS8KyZiaZfkQjbTMyodcVype.b5CBDLWR5KYALlguf6YFXnE1H2I/LHQUA/3d4pc2XTCyaTPT/');

Expected result:

$6$abcdefghijklmno$tQbBMthtllLykS8KyZiaZfkQjbTMyodcVype.b5CBDLWR5KYALlguf6YFXnE1H2I/LHQUA/3d4pc2XTCyaTPT/

Actual result:
--
$6$abcdefghi$mZusigXFSGzFIySkaCAxY4PJrrBypV.jI7bF1LK0V.vNF2COAEzCQtWCI2noXXHUs6nUYgNURmoDVCLo6Eol//





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



#48588 [Com]: pg_query_params doesn't accepted ORDER BY parameter

2009-06-24 Thread sjoerd-php at linuxonly dot nl
 ID:   48588
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  jake_lake at selinc dot com
 Status:   Open
 Bug Type: PostgreSQL related
 Operating System: Ubuntu 8.10
 PHP Version:  5.2.9
 New Comment:

Thank you for your bug report.

It would be nice if your example worked, but there are some problems
about the implementation.

In your example query, both the value for $1 and for $2 are properly
escaped. The strings passed to pg_send_query_params() are quoted and
pasted in the query. This results in the following query:
SELECT * FROM php_bug WHERE name LIKE '%o%' ORDER BY
'doesnt_exist_and_should_be_an_sql_error'

Now, in order for the behavior to change as you want, the second
parameter, $2, should not be escaped. In general, any parameter which is
part of an ORDER BY clause should not be escaped. However, this means
that pg_send_query_params() needs to parse the query, just to insert the
variables. This is error-prone, slow, inconsistent and it may still not
satisfy everybody.

So while I acknowledge that it would be nice if it worked like you say,
it is hard for PHP to know whether your parameter is a string expression
or a table name.


Previous Comments:


[2009-06-17 17:00:43] jake_lake at selinc dot com

Description:

In attempting to use the pg_query_params function, it came to my
attention that trying to use an ORDER BY with a parameter fails.  After
searching high and low I finally found someone else with the same issue.
 It was reported in Bug # 45101 and I believe falsely written-off as
bogus.

In the bug report Alan writes, " I've looked at the pg_trace() output
and it appears to be doing the right thing. All I can assume is that the
parameter is being converted to a TRUE for an ORDER BY, and so the
database happily accepts 'ORDER BY 1'."  

This makes sense as then the query should run fine using the 1 as the
column number and selecting the first column number from the table to
order on.

However, the given response by hholz...@php.net does not make any
sense.  If the expression were to truly be evaluated using a constant
string, PGSQL would return an error as strings cannot be in the ORDER BY
clause, only column headers and integers representing the column #
wanted to order on.

Therefore, it seems as Alan was more on the right track assuming that
for some reason the input value is being converted to TRUE or 1.  This
must surely be faulty behaviour as it essentially is ignoring any
parameter assigned to ORDER BY and throwing out that part of the clause
all together.  

If, however, this is the designed behaviour of this function, it should
at least be documented so that others do not get caught up debugging for
hours over this silly thing!


Reproduce code:
---
#!/opt/php/bin/php


Expected result:

If passing as constant string like hholz...@php.net claims:
ERROR:  non-integer constant in ORDER BY

If passing as column header that doesn't exist:
ERROR:  column "doesnt_exist_and_should_be_an_sql_error" does not
exist
LINE 11:   ORDER BY
doesnt_exist_and_should_be_an_sql_error;
   ^



Actual result:
--
1 - one
2 - two
4 - four





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



#48683 [Com]: stream_select returns 1 even when no streams have changed

2009-06-25 Thread sjoerd-php at linuxonly dot nl
 ID:   48683
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  php at richardneill dot org
 Status:   Open
 Bug Type: Streams related
 Operating System: Linux
 PHP Version:  5.2CVS-2009-06-25 (snap)
 New Comment:

Thank you for your bug report.

In your code example, you use /dev/null as blocking file. However, this
is not entirely correct. As you say, /dev/null gives EOF immediately,
which means stream_select sees it as ready:

"The streams listed in the read  array will be watched to see if
characters become available for reading (more precisely, to see if a
read will not block - in particular, a stream resource is also ready on
end-of-file, in which case an fread() will return a zero length
string)."

In your loop, fread() constantly read a empty string and the file
resource is constantly ready.

Maybe this information already solves your problem. If it does not,
please provide a better code example.


Previous Comments:


[2009-06-25 04:15:01] php at richardneill dot org

Description:

It seems that stream_select is failing to return 0 even if all of the
streams would block.

I've tested the code below on multiple versions of PHP from 5.2.4
upward, and get the same result on them all. 

(It's possible I've misunderstood the requirements for sockets, but
I've quintuple-checked this code.)

Reproduce code:
---
#!/usr/bin/php


Expected result:

I expect to see the line 
  stream_select returned 0
repeated every 1 second.



Actual result:
--
I get repeated instances of:
  stream_select returned 1
  did fread.

fread is returning nothing, but still the stream_select insists that
there is data available to be read!






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



#48602 [Com]: curl doesn't correct proxy authentication header

2009-06-25 Thread sjoerd-php at linuxonly dot nl
 ID:   48602
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  garakkio at gmail dot com
 Status:   Open
 Bug Type: cURL related
 Operating System: Debian Lenny
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

Do you try to authenticate to the proxy (example.org) or to the
destination server (php.net)? Have you looked at the
CURLOPT_PROXYUSERPWD option? In your bug report, the expected result and
actual result appear to be the same text. Could you clarify this?


Previous Comments:


[2009-06-19 11:04:41] garakkio at gmail dot com

Description:

If you try to get an url via a proxy with authentication, curl sends a
"Server auth" header instead of "Proxy Auth", making authentication
impossible.
If you try to get the same page using curl binary, the result is the
expected one. The curl command corresponding to php reproduce code is:

curl -v -xexample.org:80 -Ufoo:bar -o /dev/null http://www.google.com

Reproduce code:
---
http://php.net');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PROXY, 'http://example.org:80');
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); 
curl_setopt($ch, CURLOPT_USERPWD, 'foo:bar');
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_exec($ch);


Expected result:

* About to connect() to proxy example.org port 80 (#0)
*   Trying 208.77.188.166... * connected
* Connected to example.org (208.77.188.166) port 80 (#0)
* Proxy auth using Basic with user 'foo'
> GET http://php.net HTTP/1.1
Authorization: Basic Zm9vOmJhcg==
Host: php.net
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive

[...]

Actual result:
--
* About to connect() to proxy example.org port 80 (#0)
*   Trying 208.77.188.166... * connected
* Connected to example.org (208.77.188.166) port 80 (#0)
* Server auth using Basic with user 'foo'
> GET http://php.net HTTP/1.1
Authorization: Basic Zm9vOmJhcg==
Host: php.net
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive

[...]





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



#48692 [Com]: error in response

2009-06-25 Thread sjoerd-php at linuxonly dot nl
 ID:   48692
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  estudiosima at gmail dot com
 Status:   Open
 Bug Type: *General Issues
 Operating System: ubuntu 8.04
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

The behavior you describe is by design. If there are n delimeters,
explode() returns n+1 elements. It splits the string using a space, and
thus also splits using the first space. Because there is nothing before
the first space, the first element of the array is empty.

In this case, you can first trim() the string to remove spaces.


Previous Comments:


[2009-06-25 13:42:59] estudiosima at gmail dot com

Description:

if the string have a space in the begin of the string, takes the space
as a word.

Reproduce code:
---
---
>From manual page: function.explode
---

".count($b);

/* result:

Array ( [0] => [1] => word1 [2] => word2 )
3

*/
?>

Expected result:

Array ( [0]=>word1 [1]=>word2 )

Actual result:
--
Array ( [0] => [1] => word1 [2] => word2 )





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



#48704 [Com]: preg_split with limit issues similar to old explode limit issues.

2009-06-26 Thread sjoerd-php at linuxonly dot nl
 ID:   48704
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  RQuadling at GoogleMail dot com
 Status:   Open
 Bug Type: PCRE related
 Operating System: Windows XP SP3
 PHP Version:  5.3CVS-2009-06-26 (CVS)
 New Comment:

Thank you for your bug report.

The $limit parameter to explode() and preg_split() has different
meanings. They differ when $limit is negative. The behavior of $limit is
correctly documented and thus different for both functions.

Bug 48703 suggests than the preg_split() documentation gets improved to
describe that the last element of the array contains the remaining part
of the string. It does not suggest that the documentation for the limit
parameter is changed to be the same as that of explode().

Your example assumes that the $limit parameter behaves the same for
preg_split() and explode(), which is not the case. Thus, I don't think
your report describes a bug.


Previous Comments:


[2009-06-26 14:24:38] rquadl...@php.net

Missed a small point. If no limit is supplied explode() and
preg_split() 
provide the same output (with a valid or invalid delimiter).



[2009-06-26 14:20:48] RQuadling at GoogleMail dot com

Description:

This comes from the recent opened doc bug
(http://bugs.php.net/bug.php?
id=48703) and fixed bug http://bugs.php.net/bug.php?id=47560.

In #48703, the OP says that the limit on preg_split() should be 
documented the same as the limit in explode (split).

But the following code shows that the output is different in certain 
circumstances.

For #48703 to be closed with the documentation being updated to match 
that of explode, then preg_split() needs to be amended to match the 
behaviour of explode with regards to the limit parameter.




Reproduce code:
---
 '.', 'Invalid' => '_') as $valid =>
$delimiter) {
$results[$valid]['No Limit'] = explode($delimiter, $string);

foreach(range(-4, 4) as $limit) {
$explode= explode($delimiter, $string, $limit);
$preg_split = preg_split("`\\{$delimiter}`", $string, $limit);
if (serialize($explode) !== serialize($preg_split)) {
echo
"BAD: Output does not match for a 
delimiter of '$delimiter'
($valid) and a limit of $limit.", PHP_EOL,
'EXPLODE: ', implode(' : ', $explode), 
PHP_EOL,
'PREG_SPLIT : ', implode(' : ', $preg_split), 
PHP_EOL, PHP_EOL;
} else {
echo "GOOD   : Output does match for a delimiter of 
'$delimiter'
($valid) and a limit of $limit.", PHP_EOL, PHP_EOL;
}
}
}


Expected result:

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of -4.

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of -3.

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of -2.

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of -1.

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of 0.

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of 1.

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of 2.

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of 3.

GOOD : Output does not match for a delimiter of '.' (Valid) and a 
limit of 4.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of -4.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of -3.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of -2.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of -1.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of 0.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of 1.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of 2.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of 3.

GOOD : Output does not match for a delimiter of '_' (Invalid) and a 
limit of 4.

Actual result:
--
BAD: Output does not match for a delimiter of '.' (Valid) and 
a limit of -4.
EXPLODE:
PREG_SPLIT : one.two.three.four

BAD: Output does not match for a delimiter of '.' (Valid) and 
a limit of -3.
EXPLODE   

#48507 [Com]: fgetcsv() ignoring special characters

2009-06-26 Thread sjoerd-php at linuxonly dot nl
 ID:   48507
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  krynble at yahoo dot com dot br
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: Unix
 PHP Version:  5.2.9
 New Comment:

Could reproduce with php 5.2.10, php 5.2.11-dev (200906261830) and php
5.3rc4. Example code:



Expected: string(5) "?TICA"
Actual: string(4) "TICA"


Previous Comments:


[2009-06-13 18:10:03] krynble at yahoo dot com dot br

Unfortunately I'm unable to test it because the server is running in a

Datacenter.

If someone can give a feedback about it, I would apreciate.

Still, thanks for the help!



[2009-06-10 12:47:52] j...@php.net

Please try using this CVS snapshot:

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

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





[2009-06-09 14:18:39] krynble at yahoo dot com dot br

Description:

Problem using fgetcsv ignoring special characters at the begining of a

string.

The example I had was using the word "ÓTICA" with the "#" character as

separator.

Reproduce code:
---
Consider a file with the following contents: WEIRD#ÓTICA#BEHAVIOR

When using fgetcsv to parse this file, I get an output like this:

Array(
   [0] => WEIRD,
   [1] => TICA,
   [2] => BEHAVIOR
)

Expected result:

Array(
   [0] => WEIRD,
   [1] => ÓTICA,
   [2] => BEHAVIOR
)

Actual result:
--
Array(
   [0] => WEIRD,
   [1] => TICA,
   [2] => BEHAVIOR
)





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



#48607 [Com]: fwrite() doesn't check reply from ftp server before exiting

2009-06-26 Thread sjoerd-php at linuxonly dot nl
 ID:   48607
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  karachi at mail dot ru
 Status:   Open
 Bug Type: Streams related
 Operating System: FreeBSD
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

To further investigate this bug, it would be useful if you can supply
some more information. Specifically, the data sent from and to the FTP
server would be useful. You can obtain this with a sniffer such as
tcpdump or Wireshark or maybe by configuring your FTP server. You would
be looking for something like this:

230 Anonymous access granted, restrictions apply.
SIZE test_file
550 test_file: No such file or directory
EPSV 
229 Entering Extended Passive Mode (|||3110|)
STOR /test_file


Previous Comments:


[2009-06-19 16:37:37] karachi at mail dot ru

Description:

I tried to upload a file to ftp server using ftp wrapper functions.
Sequence of steps are: fopen, fwrite, fclose. Sometimes file uploaded
successfully and sometimes several last bytes of file didn't save.
Server reports in log file that transmission was aborted, but fwrite()
returns "true".
I found that fwrite() doesn't check ftp reply code before exiting.
That's why ftp server can receive QUIT command before it processes data
stored and close data connection as described in RFC 959: "The server
may abort data transfer if the control connections
are closed without command." If I insert sleep(1) between fwrite() and
fclose() everything works as expected.
Ftp server used: ProFTPD 1.3.2

Reproduce code:
---
 array(
"overwrite" => true
)
)
);

$f1 = fopen("ftp://$host/test";, 'wb', false, $context) or
die("Unable to open the file on ftp");

while ($str = fread($f, 1000))
{
fwrite($f1, $str) or die("Unable to write");
}

fclose($f1);
fclose($f);
?>

Expected result:

File is successfully stored on ftp server

Actual result:
--
Sometimes end of the file isn't stored. It doesn't depend on the size
of the file.





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



#48714 [Com]: When calling parent class method, self is responding

2009-06-30 Thread sjoerd-php at linuxonly dot nl
 ID:   48714
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  sebcorne at gmail dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows
 PHP Version:  5.3.0RC4
 New Comment:

Thank you for your bug report.

Are you sure the behavior you describes is not documented? Please take
a look at:
http://nl.php.net/manual/en/language.oop5.late-static-bindings.php#language.oop5.late-static-bindings.edge-cases


Previous Comments:


[2009-06-30 05:45:29] sebcorne at gmail dot com

class base
{
static public function __callstatic($name, $arguments)
{
echo get_called_class() . "::$name() is called \n\n";
}
public function __call($name, $arguments)
{
echo get_called_class() . "->$name() is called \n\n";
}
}



give the same result.
but without "__call()", it's ok.

if "$this" exists in inheritance, "__call()" (of $this) is called
instead of "__callstatic()"



[2009-06-29 09:17:57] sebcorne at gmail dot com

Description:

Tested on php5.3.0-alpha3 (must be tested on last snap)

When calling parent class method, self is responding

(sorry for my bad english)

Reproduce code:
---
class base
{
public function __call($name, $arguments)
{
echo get_called_class() . "->$name() is called \n\n";
}
}


class A extends base
{
public function parent_automatic()
{
$parentclass = get_parent_class($this);
echo get_class($this) . '->'. __FUNCTION__ ."() call
$parentclass::test() \n";
$parentclass::test();
}

public function parent_manual()
{
echo get_class($this) . '->'. __FUNCTION__ ."() call A::test() 
\n";
A::test();
}
}


class B extends A {}



$b = new B;
$b->parent_automatic();
$b->parent_manual();


Expected result:

B->parent_automatic() call A::test() 
A->test() is called 

B->parent_manual() call A::test() 
A->test() is called 


Actual result:
--
B->parent_automatic() call A::test() 
B->test() is called 

B->parent_manual() call A::test() 
B->test() is called 






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



#48744 [Com]: Segmentation fault with open_basedir enabled

2009-07-01 Thread sjoerd-php at linuxonly dot nl
 ID:   48744
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  tom at ideaweb dot de
 Status:   Open
 Bug Type: Safe Mode/open_basedir
 Operating System: Linux Debian Etch
 PHP Version:  5.3.0
 New Comment:

Are you perhaps running a multithreaded Apache server with a
non-thread-safe PHP module?

Check "Thread Safety" in phpinfo() and whether you have
apache2-mpm-worker or apache2-mpm-prefork.


Previous Comments:


[2009-07-01 07:33:34] tom at ideaweb dot de

Its really strange, because i have several php53 installations without

any trouble with the same configuration, but only on one dev server it

crashes. if you cannot reproduce, its not a big deal that you can get 
access to our dev server, there are not secrets and no data...



ServerAdmin webmas...@ecolint.ch

ServerName ecodev.ecolint.ch
ServerAlias ecm.ideaweb.de
ServerAlias 217.169.129.40

#ErrorDocument 404 /

DocumentRoot /var/www/ecolint.ch/dev/ecolint/trunk/admin

CustomLog /var/www/ecolint.ch/logs/access_log combined
ErrorLog /var/www/ecolint.ch/logs/error_log


Options -MultiViews -Indexes -Includes +FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all


Alias /mysql/ /var/www/ecolint.ch/mysql/


Options -MultiViews -Indexes -Includes -FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all


php_admin_flag register_globals off
php_admin_flag magic_quotes_gpc off
php_admin_flag magic_quotes_runtime off
php_admin_value default_charset utf-8
php_admin_value session.save_path /www/htdocs/ecolint.ch/tmp/
php_admin_value upload_tmp_dir /www/htdocs/ecolint.ch/tmp/
php_admin_value open_basedir 
/www/htdocs/ecolint.ch/dev:/www/htdocs/ecolint.ch/tmp:/www/htdocs/ecol
int.ch/mysql

RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]





[2009-07-01 05:56:00] ras...@php.net

I can't reproduce this.  Where in your apache.conf do you have that
line?  As in which config blocks is it inside?



[2009-06-30 16:40:31] tom at ideaweb dot de

Description:

Segmentation fault if the following line is enabled in apache.conf:

php_admin_value open_basedir 
/www/htdocs/ecolint.ch/dev:/www/htdocs/ecolint.ch/tmp:/www/htdocs/ecol
int.ch/mysql

Maybe i made something wrong or its not a bug in php, because i not 
really understand the debug output, but i hope it helps =)

(gdb) run -X
Starting program: /www/apache/2.2.11/bin/httpd -X
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1212832064 (LWP 4837)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1212832064 (LWP 4837)]
0xb757a7b7 in OnUpdateBaseDir (entry=0x824fba0, 
new_value=0x83b6398 
"/www/htdocs/ecolint.ch/dev:/www/htdocs/ecolint.ch/tmp:/www/htdocs/eco
lint.ch/mysql", 
new_value_length=82, mh_arg1=0x48, mh_arg2=0xb7b593a0, 
mh_arg3=0x0, stage=4) at /www/src/php-5.3.0/main/fopen_wrappers.c:103
103 if (!*p || !**p) {
(gdb) bt
#0  0xb757a7b7 in OnUpdateBaseDir (entry=0x824fba0, 
new_value=0x83b6398 
"/www/htdocs/ecolint.ch/dev:/www/htdocs/ecolint.ch/tmp:/www/htdocs/eco
lint.ch/mysql", 
new_value_length=82, mh_arg1=0x48, mh_arg2=0xb7b593a0, 
mh_arg3=0x0, stage=4) at /www/src/php-5.3.0/main/fopen_wrappers.c:103
#1  0xb75f6d09 in zend_alter_ini_entry_ex (name=0x819a670 
"open_basedir", name_length=13, 
new_value=0x8228770 
"/www/htdocs/ecolint.ch/dev:/www/htdocs/ecolint.ch/tmp:/www/htdocs/eco
lint.ch/mysql", 
new_value_length=82, modify_type=4, stage=4, force_change=0) at 
/www/src/php-5.3.0/Zend/zend_ini.c:285
#2  0xb75f6b0f in zend_alter_ini_entry (name=0x819a670 "open_basedir",

name_length=13, 
new_value=0x8228770 
"/www/htdocs/ecolint.ch/dev:/www/htdocs/ecolint.ch/tmp:/www/htdocs/eco
lint.ch/mysql", 
new_value_length=82, modify_type=4, stage=4) at /www/src/php-
5.3.0/Zend/zend_ini.c:243
#3  0xb76a86b6 in apply_config (dummy=0x8228df8) at /www/src/php-
5.3.0/sapi/apache2handler/apache_config.c:197
#4  0xb76a7a73 in php_handler (r=0x837fe30) at /www/src/php-
5.3.0/sapi/apache2handler/sapi_apache2.c:547
#5  0x0807dad7 in ap_run_handler (r=0x837fe30) at config.c:157
#6  0x08080bc7 in ap_invoke_handler (r=0x837fe30) at config.c:372
#7  0x080c8658 in ap_process_request (r=0x837fe30) at 
http_request.c:282
#8  0x080c581e in ap_process_http_connection (c=0x836fd40) at 
http_core.c:190
#9  0x08084a87 in ap_run_process_connection (c=0x836fd40) at 
connection.c:43
#10 0x080f846d in child_main (child_num_arg=) at 
prefork.c:

#48754 [Com]: mysql_close() crash php

2009-07-01 Thread sjoerd-php at linuxonly dot nl
 ID:   48754
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  busia at tiscali dot it
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: Windows Vista
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

I have a couple of questions regarding your bug report:
1. Is the sleep(2) needed to reproduce the bug?
2. Does the database connection succeed? (i.e. what is the return value
of mysql_connect?)


Previous Comments:


[2009-07-01 12:30:54] busia at tiscali dot it

Description:

This simple code crash php.

This is the Debug diagnostic tool output:

In
php__PID__5128__Date__07_01_2009__Time_02_22_25PM__909__Second_Chance_Exception_C005.dmp
the assembly instruction at php_mysql!zif_mysql_close+92 in C:\Program
Files\PHP\ext\php_mysql.dll from The PHP Group has caused an access
violation exception (0xC005) when trying to read from memory
location 0x on thread 0


Report for
php__PID__5128__Date__07_01_2009__Time_02_22_25PM__909__Second_Chance_Exception_C005.dmp
Type of Analysis Performed   Crash Analysis 
Machine Name   PC-UTENTE 
Operating System   Windows Vista Service Pack 1 
Number Of Processors   2 
Process ID   5128 
Process Image   C:\Program Files\PHP\php.exe 
System Up-Time   00:13:11 
Process Up-Time   00:00:02 


Thread 0 - System ID 5132
Entry point   php!mainCRTStartup 
Create time   01/07/2009 14.22.23 
Time spent in user mode   0 Days 0:0:0.31 
Time spent in kernel mode   0 Days 0:0:0.62 






Function Arg 1 Arg 2 Arg 3   Source 
php_mysql!zif_mysql_close+92  02a0d350    

php5ts!zend_do_fcall_common_helper_SPEC+946  02a40070  
  00052fd0
php5ts!ZEND_DO_FCALL_SPEC_CONST_HANDLER+130 00c0fbd4 00052fd0  
  00c0fe70
php5ts!execute+29e 02a40070 00052f00 
php5ts!zend_execute_scripts+f6 0008 00052fd0   
 
php5ts!php_execute_script+22d 00c0fe70 00052fd0    

php!main+bf1 0002 00052f68 00051888
php!mainCRTStartup+e3 7ffdb000 00c0ffd4 77bee4b6
kernel32!BaseThreadInitThunk+e 7ffdb000 770bbeaf   
 
ntdll!__RtlUserThreadStart+23 00402d78 7ffdb000    

ntdll!_RtlUserThreadStart+1b 00402d78 7ffdb000    





PHP_MYSQL!ZIF_MYSQL_CLOSE+92In
php__PID__5128__Date__07_01_2009__Time_02_22_25PM__909__Second_Chance_Exception_C005.dmp
the assembly instruction at php_mysql!zif_mysql_close+92 in C:\Program
Files\PHP\ext\php_mysql.dll from The PHP Group has caused an access
violation exception (0xC005) when trying to read from memory
location 0x on thread 0

Module Information 
Image Name: C:\Program Files\PHP\ext\php_mysql.dll   Symbol Type:  PDB

Base address: 0x01c3   Time Stamp:  Mon Jun 29 22:24:49 2009  
Checksum: 0x   Comments:  Thanks to Zeev Suraski, Zak Greant,
Georg Richter 
COM DLL: False   Company Name:  The PHP Group 
ISAPIExtension: False   File Description:  MySQL 
ISAPIFilter: False   File Version:  5.3.0 
Managed DLL: False   Internal Name:  MYSQL extension 
VB DLL: False   Legal Copyright:  Copyright © 1997-2009 The PHP Group 
Loaded Image Name:  php_mysql.dll   Legal Trademarks:  PHP 
Mapped Image Name:  C:\Program Files\PHP\ext\php_mysql.dll   Original
filename:  php_mysql.dll 
Module name:  php_mysql   Private Build:   
Single Threaded:  False   Product Name:  PHP 
Module Size:  44,00 KBytes   Product Version:  5.3.0 
Symbol File Name: 
C:\Users\utente\Desktop\php-debug-pack-5.3.0-Win32-VC6-x86\php_mysql.pdb
  Special Build:  & 




Reproduce code:
---







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



#48723 [Com]: mssql_close($res) do not actually close connection

2009-07-01 Thread sjoerd-php at linuxonly dot nl
 ID:   48723
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  andrey at djhd dot com
 Status:   Open
 Bug Type: MSSQL related
 Operating System: XP SP2
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

How did you determine that the connection was not closed?


Previous Comments:


[2009-06-29 17:59:46] andrey at djhd dot com

Description:

I have persistent connections turned off.
mssql_close will not close connection if it was opened with resource
link.
If no resource link and everything by default then everything ok.

Reproduce code:
---
$link1 = mssql_connect ($servername,"sa","pass",1);
mssql_close ($link1);
sleep (1000);


Expected result:

I expect that it will disconnect and then sleep

Actual result:
--
It disconnects only on exit from the script.

The following works:

mssql_connect ($servername,"sa","moyadatabase",1);
mssql_close ();
sleep (1000);






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



#48718 [Com]: FILTER_VALIDATE_EMAIL does not allow number

2009-07-01 Thread sjoerd-php at linuxonly dot nl
 ID:   48718
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  glj dot klomp at gmail dot com
 Status:   Open
 Bug Type: Filter related
 Operating System: *
 PHP Version:  5.2.10
 New Comment:

diff -u -r1.1.2.22.2.12 logical_filters.c
--- ext/filter/logical_filters.c10 Jun 2009 19:01:17
-   1.1.2.22.2.12
+++ ext/filter/logical_filters.c1 Jul 2009 19:01:42 -
@@ -472,7 +472,7 @@
 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
/* From
http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4
*/
-   const char regexp[] =
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?(\\.(?=[A-Za-z\\-]))?)+[A-Za-z\\-]*))$/D";
+   const char regexp[] =
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?(\\.(?=[A-Za-z0-9]))?)+[A-Za-z\\-]*))$/D";
 
pcre   *re = NULL;
pcre_extra *pcre_extra = NULL;
diff -u -N
/home/sjoerd/dev/php/php-5.3.0/ext/filter/tests/bug48718.phpt
ext/filter/tests/bug48718.phpt
---
/home/sjoerd/dev/php/php-5.3.0/ext/filter/tests/bug48718.phpt   1970-01-01
01:00:00.0 +0100
+++ ext/filter/tests/bug48718.phpt  2009-07-01 20:54:54.0 +0200
@@ -0,0 +1,11 @@
+--TEST--
+bug 48718, FILTER_VALIDATE_EMAIL does not allow number
+--SKIPIF--
+
+--FILE--
+
+--EXPECT-- 
+string(18) "t...@mail.2php.net"


Previous Comments:


[2009-06-29 12:39:25] glj dot klomp at gmail dot com

Description:

When supplying the filter_var() function with a domain containing a
number at the front of the domain, and using a subdomain, the filter
fails.

firstname.lastn...@employee.2something.com - Failed
firstname.lastn...@employee.something.com - Success
firstname.lastn...@2something.com - Success

Reproduce code:
---
echo '',
var_dump(filter_var('firstname.lastn...@employee.2something.com',
FILTER_VALIDATE_EMAIL)), '';

Expected result:

string(42) "firstname.lastn...@employee.2something.com"


Actual result:
--
bool(false)





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



#48770 [Com]: call_user_func_array fails to call parent from inheriting class

2009-07-02 Thread sjoerd-php at linuxonly dot nl
 ID:   48770
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  lumeet at yahoo dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: Windows XP SP3
 PHP Version:  5.3CVS-2009-07-02 (snap)
 New Comment:

Thank you for your bug report. I could reproduce it and added some more
data:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d03b80 (LWP 6726)]
0x082dee15 in zend_is_callable_ex (callable=0x9e3cdc0, object_ptr=0x0,

check_flags=0, callable_name=0x0, callable_name_len=0x0,
fcc=0xbf49d190, 
error=0xbf49d0e8) at
/home/sjoerd/dev/php/trunk/php5/Zend/zend_API.c:2624
2624{
#0  0x082dee15 in zend_is_callable_ex (callable=0x9e3cdc0,
object_ptr=0x0, 
check_flags=0, callable_name=0x0, callable_name_len=0x0,
fcc=0xbf49d190, 
error=0xbf49d0e8) at
/home/sjoerd/dev/php/trunk/php5/Zend/zend_API.c:2624
#1  0x082df489 in zend_fcall_info_init (callable=0x9e3cdc0,
check_flags=0, 
fci=0xbf49d16c, fcc=0xbf49d190, callable_name=0x0,
error=0xbf49d0e8)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_API.c:2858
#2  0x082e35a2 in zend_parse_va_args (num_args=2, type_spec=0x85b0091
"a/", 
va=0xbf49d13c, flags=0)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_API.c:592
#3  0x082e3d12 in zend_parse_parameters (num_args=2,
type_spec=0xbf49d0e8 "")
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_API.c:870
#4  0x08220dd1 in zif_call_user_func_array (ht=2,
return_value=0x9e3ce7c, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)
at
/home/sjoerd/dev/php/trunk/php5/ext/standard/basic_functions.c:4748
#5  0x083259b9 in zend_do_fcall_common_helper_SPEC
(execute_data=0x9de07bc)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_vm_execute.h:313
#6  0x08302dbe in execute (op_array=0x9448e90)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_vm_execute.h:104
#7  0x082d0c77 in zend_call_function (fci=0xbf49d37c,
fci_cache=0xbf49d3a0)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_execute_API.c:936
#8  0x08220df7 in zif_call_user_func_array (ht=2,
return_value=0x9e3ccb0, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)
at
/home/sjoerd/dev/php/trunk/php5/ext/standard/basic_functions.c:4755
#9  0x083259b9 in zend_do_fcall_common_helper_SPEC
(execute_data=0x9de06fc)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_vm_execute.h:313
#10 0x08302dbe in execute (op_array=0x9448e90)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_vm_execute.h:104
#11 0x082d0c77 in zend_call_function (fci=0xbf49d58c,
fci_cache=0xbf49d5b0)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_execute_API.c:936
#12 0x08220df7 in zif_call_user_func_array (ht=2,
return_value=0x9e3cae4, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)
at
/home/sjoerd/dev/php/trunk/php5/ext/standard/basic_functions.c:4755

...

#11213 0x083259b9 in zend_do_fcall_common_helper_SPEC
(execute_data=0x9c1d004)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_vm_execute.h:313
#11214 0x08302dbe in execute (op_array=0x9448e90)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_vm_execute.h:104
#11215 0x082d0c77 in zend_call_function (fci=0xbf60669c,
fci_cache=0xbf6066c0)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_execute_API.c:936
#11216 0x08220df7 in zif_call_user_func_array (ht=2,
return_value=0x9c822d4, 
return_value_ptr=0x0, this_ptr=0x0, return_value_used=0)
at
/home/sjoerd/dev/php/trunk/php5/ext/standard/basic_functions.c:4755
#11217 0x083259b9 in zend_do_fcall_common_helper_SPEC
(execute_data=0x9c1cf44)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_vm_execute.h:313
#11218 0x08302dbe in execute (op_array=0x9448e90)
at /home/sjoerd/dev/php/trunk/php5/Zend/zend_vm_execute.h:104
etc. etc.


Previous Comments:


[2009-07-02 07:28:31] lumeet at yahoo dot com

Description:

When class C extends B, which extends A, calls from B to its parent 
methods fail when using call_user_func_array(). Using parent::func()
works just fine.

Reproduce code:
---
class A {
  function func( $str ) {
echo $str;
  }
}

class B extends A {
  public function func( $str ) {
call_user_func_array( array( $this, 'parent::func' ), array( $str )
);
  }
}

class C extends B {
  public function func( $str ) {
parent::func( $str );
  }
}

$c = new C;
$c->func( 'This should work!' );

Expected result:

The code should output "This should work!".

Actual result:
--
PHP crashes with backtrace (yes, only one line):

Function Arg 1 Arg 2 Arg 3   Source 
php5ts!zend_is_callable_ex+61e 011f0780 0006 003228e0  
 





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



#48779 [Com]: Use of HOST section cause 500 error

2009-07-02 Thread sjoerd-php at linuxonly dot nl
 ID:   48779
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  keithdavis at pridedallas dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: Windows Vista Business x86
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

Is there additional information in the IIS or PHP error log?


Previous Comments:


[2009-07-02 15:28:24] keithdavis at pridedallas dot com

Description:

I am running PHP on IIS7 and when I try to use the HOST section, I get
a 500 Internal Server error every time. Here is the section
implementations that I have tried:



Reproduce code:
---
---
>From manual page: ini.sections
---
[HOST=intranet.pridedallas.com]
track_errors = Off
html_errors = Off
session.bug_compat_42 = Off

AND

[HOST=intranet]
track_errors = Off
html_errors = Off
session.bug_compat_42 = Off

Actual result:
--
HTTP Error 500.0 - Internal Server Error
C:\PHP\php-cgi.exe - The FastCGI process exited unexpectedly





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



#48723 [Com]: mssql_close($res) do not actually close connection

2009-07-04 Thread sjoerd-php at linuxonly dot nl
 ID:   48723
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  andrey at djhd dot com
 Status:   Open
 Bug Type: MSSQL related
 Operating System: XP SP2
 PHP Version:  5.2.10
 New Comment:

Andrey said:
> I see it in the profiler.
> In good case there is Logout record before sleep, in bad - nothing.


Previous Comments:


[2009-07-01 18:07:19] sjoerd-php at linuxonly dot nl

Thank you for your bug report.

How did you determine that the connection was not closed?



[2009-06-29 17:59:46] andrey at djhd dot com

Description:

I have persistent connections turned off.
mssql_close will not close connection if it was opened with resource
link.
If no resource link and everything by default then everything ok.

Reproduce code:
---
$link1 = mssql_connect ($servername,"sa","pass",1);
mssql_close ($link1);
sleep (1000);


Expected result:

I expect that it will disconnect and then sleep

Actual result:
--
It disconnects only on exit from the script.

The following works:

mssql_connect ($servername,"sa","moyadatabase",1);
mssql_close ();
sleep (1000);






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



#48803 [Com]: fprintf(STDOUT, ...) and printf(...) behave differently and affect STDERR

2009-07-05 Thread sjoerd-php at linuxonly dot nl
 ID:   48803
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  andrey dot vihrov at gmail dot com
 Status:   Open
 Bug Type: Output Control
 Operating System: Gentoo Linux amd64
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

The problem is not that STDERR is affected, but that the script is
terminated immediately. Furthermore, it is not specific for printf.

time php -r 'echo 'a'; sleep(5);' > /dev/full
Expected: real  0m5.030s
Actual: real0m0.030s

Your contrived example writes to /dev/full, which obviously fails. Do
you have a more real-life example where writing to STDOUT fails?


Previous Comments:


[2009-07-05 10:25:31] andrey dot vihrov at gmail dot com

Description:

These functions behave differently if the underlying I/O operation on
STDOUT fails. The difference is that STDERR is affected in one case.

Configure Command =>  './configure'  '--prefix=/usr/lib64/php5'
'--host=x86_64-pc-linux-gnu' '--mandir=/usr/lib64/php5/man'
'--infodir=/usr/lib64/php5/info' '--sysconfdir=/etc'
'--cache-file=./config.cache' '--with-libdir=lib64'
'--with-pcre-regex=/usr' '--enable-cli' '--disable-cgi'
'--with-config-file-path=/etc/php/cli-php5'
'--with-config-file-scan-dir=/etc/php/cli-php5/ext-active'
'--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar'
'--disable-ctype' '--without-curl' '--without-curlwrappers'
'--disable-dbase' '--enable-exif' '--without-fbsql' '--without-fdftk'
'--disable-filter' '--disable-ftp' '--with-gettext' '--without-gmp'
'--disable-hash' '--disable-ipv6' '--disable-json'
'--without-kerberos'
'--enable-mbstring' '--with-mcrypt' '--without-mhash' '--without-msql'
'--without-mssql' '--with-ncurses' '--with-openssl'
'--with-openssl-dir=/usr' '--disable-pcntl' '--disable-pdo'
'--without-pgsql' '--disable-posix' '--with-pspell' '--without-recode'
'--disable-simplexml' '--disable-shmop' '--without-snmp'
'--disable-soap' '--disable-sockets' '--without-sybase'
'--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem'
'--disable-sysvshm' '--without-tidy' '--disable-tokenizer'
'--disable-wddx' '--disable-xmlreader' '--disable-xmlwriter'
'--without-xmlrpc' '--without-xsl' '--disable-zip' '--with-zlib'
'--disable-debug' '--enable-dba' '--without-cdb' '--with-db4'
'--disable-flatfile' '--with-gdbm' '--disable-inifile'
'--without-qdbm'
'--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv'
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir'
'--with-gd' '--without-mysqli' '--with-readline' '--without-libedit'
'--without-mm' '--with-sqlite=/usr' '--enable-sqlite-utf8'

> diff php.ini-dist /etc/php/cli-php5/php.ini 
474c474
< ;include_path = ".:/php/includes"
---
> include_path = ".:/usr/share/php5:/usr/share/php"
491c491
< extension_dir = "./"
---
> extension_dir =
/usr/lib64/php5/lib/php/extensions/no-debug-non-zts-20060613
560c560
< allow_url_fopen = On
---
> allow_url_fopen = Off
1283a1284,1288
> 
> ; MySQL extensions default connection charset settings
> ;mysql.connect_charset = utf8
> ;mysqli.connect_charset = utf8
> ;pdo_mysql.connect_charset = utf8

Reproduce code:
---
Script #1

#! /usr/bin/php


Testcase #2

#! /usr/bin/php


Expected result:

> ./test1.php > /dev/full
stderr
> ./test2.php > /dev/full
stderr
>

Actual result:
--
> ./test1.php > /dev/full
stderr
> ./test2.php > /dev/full
>





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



#48802 [Com]: Errors are not reported for STDOUT/STDERR

2009-07-05 Thread sjoerd-php at linuxonly dot nl
 ID:   48802
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  andrey dot vihrov at gmail dot com
 Status:   Open
 Bug Type: Output Control
 Operating System: Gentoo Linux amd64
 PHP Version:  5.2.10
 New Comment:

See bug #48803.


Previous Comments:


[2009-07-05 09:47:19] andrey dot vihrov at gmail dot com

Description:

There is no way to tell that output to STDOUT/STDERR failed.

Configure Command =>  './configure'  '--prefix=/usr/lib64/php5'
'--host=x86_64-pc-linux-gnu' '--mandir=/usr/lib64/php5/man'
'--infodir=/usr/lib64/php5/info' '--sysconfdir=/etc'
'--cache-file=./config.cache' '--with-libdir=lib64'
'--with-pcre-regex=/usr' '--enable-cli' '--disable-cgi'
'--with-config-file-path=/etc/php/cli-php5'
'--with-config-file-scan-dir=/etc/php/cli-php5/ext-active'
'--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar'
'--disable-ctype' '--without-curl' '--without-curlwrappers'
'--disable-dbase' '--enable-exif' '--without-fbsql' '--without-fdftk'
'--disable-filter' '--disable-ftp' '--with-gettext' '--without-gmp'
'--disable-hash' '--disable-ipv6' '--disable-json' '--without-kerberos'
'--enable-mbstring' '--with-mcrypt' '--without-mhash' '--without-msql'
'--without-mssql' '--with-ncurses' '--with-openssl'
'--with-openssl-dir=/usr' '--disable-pcntl' '--disable-pdo'
'--without-pgsql' '--disable-posix' '--with-pspell' '--without-recode'
'--disable-simplexml' '--disable-shmop' '--without-snmp'
'--disable-soap' '--disable-sockets' '--without-sybase'
'--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem'
'--disable-sysvshm' '--without-tidy' '--disable-tokenizer'
'--disable-wddx' '--disable-xmlreader' '--disable-xmlwriter'
'--without-xmlrpc' '--without-xsl' '--disable-zip' '--with-zlib'
'--disable-debug' '--enable-dba' '--without-cdb' '--with-db4'
'--disable-flatfile' '--with-gdbm' '--disable-inifile' '--without-qdbm'
'--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv'
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir'
'--with-gd' '--without-mysqli' '--with-readline' '--without-libedit'
'--without-mm' '--with-sqlite=/usr' '--enable-sqlite-utf8'

> diff php.ini-dist /etc/php/cli-php5/php.ini 
474c474
< ;include_path = ".:/php/includes"
---
> include_path = ".:/usr/share/php5:/usr/share/php"
491c491
< extension_dir = "./"
---
> extension_dir =
/usr/lib64/php5/lib/php/extensions/no-debug-non-zts-20060613
560c560
< allow_url_fopen = On
---
> allow_url_fopen = Off
1283a1284,1288
> 
> ; MySQL extensions default connection charset settings
> ;mysql.connect_charset = utf8
> ;mysqli.connect_charset = utf8
> ;pdo_mysql.connect_charset = utf8

Reproduce code:
---
#! /usr/bin/php


Expected result:

A /dev/full pseudo-device in Linux is "always full", and any writes to
it fail. When run as "./test.php > /dev/full", the script should exit
unsuccessfully (with exit status 1).

Actual result:
--
> ./test.php > /dev/full
> echo $?
0






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



#48718 [Com]: FILTER_VALIDATE_EMAIL does not allow number

2009-07-06 Thread sjoerd-php at linuxonly dot nl
 ID:   48718
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  glj dot klomp at gmail dot com
 Status:   Assigned
 Bug Type: Filter related
 Operating System: *
 PHP Version:  5.2.10
 Assigned To:  iliaa
 New Comment:

Here is another regex for e-mail validation:
http://ex-parrot.com/~pdw/Mail-RFC822-Address.html

It is hard to get it right, at least with a regex.


Previous Comments:


[2009-07-05 17:11:01] fel...@php.net

But now it accepts TLD containing numbers.



[2009-07-05 16:08:20] il...@php.net

This bug has been fixed in CVS.

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.





[2009-07-02 06:32:27] sjoerd-php at linuxonly dot nl

diff -u -r1.1.2.22.2.12 logical_filters.c
--- ext/filter/logical_filters.c10 Jun 2009 19:01:17
-   1.1.2.22.2.12
+++ ext/filter/logical_filters.c1 Jul 2009 19:01:42 -
@@ -472,7 +472,7 @@
 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
 {
/* From
http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4
*/
-   const char regexp[] =
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?(\\.(?=[A-Za-z\\-]))?)+[A-Za-z\\-]*))$/D";
+   const char regexp[] =
"/^((\\\"[^\\\"\\f\\n\\r\\t\\b]+\\\")|([A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[A-Za-z0-9_\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]*)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9])(([A-Za-z0-9\\-])*([A-Za-z0-9]))?(\\.(?=[A-Za-z0-9]))?)+[A-Za-z\\-]*))$/D";
 
pcre   *re = NULL;
pcre_extra *pcre_extra = NULL;
diff -u -N
/home/sjoerd/dev/php/php-5.3.0/ext/filter/tests/bug48718.phpt
ext/filter/tests/bug48718.phpt
---
/home/sjoerd/dev/php/php-5.3.0/ext/filter/tests/bug48718.phpt   1970-01-01
01:00:00.0 +0100
+++ ext/filter/tests/bug48718.phpt  2009-07-01 20:54:54.0 +0200
@@ -0,0 +1,11 @@
+--TEST--
+bug 48718, FILTER_VALIDATE_EMAIL does not allow number
+--SKIPIF--
+
+--FILE--
+
+--EXPECT-- 
+string(18) "t...@mail.2php.net"



[2009-06-29 12:39:25] glj dot klomp at gmail dot com

Description:

When supplying the filter_var() function with a domain containing a
number at the front of the domain, and using a subdomain, the filter
fails.

firstname.lastn...@employee.2something.com - Failed
firstname.lastn...@employee.something.com - Success
firstname.lastn...@2something.com - Success

Reproduce code:
---
echo '',
var_dump(filter_var('firstname.lastn...@employee.2something.com',
FILTER_VALIDATE_EMAIL)), '';

Expected result:

string(42) "firstname.lastn...@employee.2something.com"


Actual result:
--
bool(false)





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



#48808 [Com]: Wrong e-mail format is accept with FILTER_VALIDATE_EMAIL

2009-07-06 Thread sjoerd-php at linuxonly dot nl
 ID:   48808
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  fel...@php.net
 Status:   Assigned
 Bug Type: Filter related
 Operating System: Linux
 PHP Version:  5.2CVS-2009-07-05 (CVS)
 Assigned To:  iliaa
 New Comment:

Maybe already fixed while fixing bug #48718.


Previous Comments:


[2009-07-05 17:13:58] fel...@php.net

Description:

See below.

Tested with 5.2 and 5.3CVS.

Reproduce code:
---
var_dump(filter_var("-...@a.-", FILTER_VALIDATE_EMAIL));

Expected result:

bool(false)

Actual result:
--
string(5) "-...@a.-"





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



#48829 [Com]: mail connectivity problem

2009-07-07 Thread sjoerd-php at linuxonly dot nl
 ID:   48829
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  lakshmi at nace dot co dot in
 Status:   Open
 Bug Type: *Mail Related
 Operating System: Windows and Linux
 PHP Version:  5.2.10
 New Comment:

Thank you for your report.

The issue you report is not a bug, rather a request for support. This
bug tracker is not the right place for support. Instead, try here:
IRC: irc.freenode.org ##php
Usenet: comp.lang.php, alt.comp.lang.php
Mailing lists: http://www.php.net/mailing-lists.php
WWW: http://stackoverflow.com/questions/tagged/php


Previous Comments:


[2009-07-07 06:42:10] lakshmi at nace dot co dot in

Description:

OS   Windows XP home Edition, Redhat Linux 5
Server   Apache 2.2.11
PHP  5.2.9-2


I get this:

Warning: mail(): Failed to connect to mailserver at "localhost" port
25,
verify your "SMTP" and "smtp_port" setting in php.ini or use
ini_set().

I tried by changing the php.ini and it does not work.

I hope you can help me

Request: This is the third time I am posting this query to PHP Bugs,
But
Still I haven't get any Proper Solutions.

Thanks a lot

Reproduce code:
---
\r\n"; //optional
headerfields

if(mail($recipient, $subject, $mail_body, $header)) //mail command :)
echo "mail sent";
else
echo "mail not sent";
?>


Expected result:

It has to reach to the destination email id 

Actual result:
--
Mail Sent 





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



#48830 [Com]: eval() parser error/warning on \'

2009-07-07 Thread sjoerd-php at linuxonly dot nl
 ID:   48830
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  s dot coletta at unidata dot it
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows/Ubuntu
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

The issue you report is not a bug. Both strings in your example look
like this:
define('A','C:\Dir\');

Note that the last single quote is escaped by the backslash. Passing
this to eval or putting this string in a PHP file will rightfully give a
parse error, because there is no ending quote.


Previous Comments:


[2009-07-07 09:23:25] s dot coletta at unidata dot it

Description:

Eval() makes a wrong parsing of a string ending with \\' or \'

The "Reproduce code" will not fail if you remove the ending \\ or \
like:

$str = "define('A','C:\\Dir');"; or
$str = "define('A','C:\Dir');";


Reproduce code:
---
$str = "define('A','C:\\Dir\\');";
eval($str);

or 

$str = "define('A','C:\Dir\');";
eval($str);


Expected result:

No warnings or errors.

Just this statement executed:

define('A','C:\Dir\');


Actual result:
--
For both examples provided the result is the same:


Warning: Unexpected character in input: ''' (ASCII=39) state=1 in
/test.php(3) : eval()'d code on line 1

Parse error: syntax error, unexpected ':' in /test.php(3) : eval()'d
code on line 1





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



#48824 [Com]: dateTime->add() doesn't properly account for days past the end of months

2009-07-07 Thread sjoerd-php at linuxonly dot nl
 ID:   48824
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  brad at omnis dot com
 Status:   Open
 Bug Type: Date/time related
 Operating System: Linux (CentOS 5.3)
 PHP Version:  5.3.0
 New Comment:

Thank you for your report.

The issue you report is not a bug. See also bug #43999.


Previous Comments:


[2009-07-06 22:24:39] brad at omnis dot com

Description:

dateTime->add(dateInterval) isn't applying proper calendar math when
adding intervals.

Reproduce code:
---
$dateTest = new dateTime('2008-01-31',new dateTimeZone("GMT"));
print_r($dateTest);

$dateTest->add(new dateInterval('P1M'));
print_r($dateTest);


Expected result:

DateTime Object
(
[date] => 2008-01-31 00:00:00
[timezone_type] => 3
[timezone] => UTC
)
DateTime Object
(
[date] => 2008-02-28 00:00:00
[timezone_type] => 3
[timezone] => UTC
)


Actual result:
--
DateTime Object
(
[date] => 2008-01-31 00:00:00
[timezone_type] => 3
[timezone] => UTC
)
DateTime Object
(
[date] => 2008-03-02 00:00:00
[timezone_type] => 3
[timezone] => UTC
)






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



#48858 [Com]: array item definition problem?

2009-07-09 Thread sjoerd-php at linuxonly dot nl
 ID:   48858
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  justin dot carlson at gmail dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report. 

I was able to reproduce the problem and make the testcase somewhat
simpler:

 'First',
self::D => 'Last'
);
}   
print_r(Foo::$sample);
?>


Previous Comments:


[2009-07-08 22:15:10] justin dot carlson at gmail dot com

Description:

Array items are not as defined when using the same key twice.

I have not yet tested this outside of a class.







Reproduce code:
---
 'Apple',
self::B => 'Boy',
self::C => 'Cat',
self::D => 'Dog'
);
   
public static function Bar() {
print_R( self::$sample );
}
}   
?>

Expected result:

In PHP 5.2.x:

Array
(
[2] => Boy
[3] => Cat
[1] => Dog
)

This is what I would expect to be valid, as the 2nd entry would
override the first, making "Dog" the correct value for index 1.

Actual result:
--
In PHP 5.3.x:

Array
(
[1] => Apple
[2] => Boy
[3] => Cat
)

This was not expected, as the 1st entry maintained it's value.






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



#48863 [Com]: Fatal error on main/internal_functions_cli.lo

2009-07-09 Thread sjoerd-php at linuxonly dot nl
 ID:   48863
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  jpmendoza at pldt dot com dot ph
 Status:   Open
 Bug Type: Compile Failure
 Operating System: Solaris 10
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

It seems that libnet can not be found. Configure should give an error
about this. For the moment, installing libnet should fix your problem.


Previous Comments:


[2009-07-09 02:05:12] jpmendoza at pldt dot com dot ph

Description:

Hi I'm trying to install php on solaris 10 with oracle.
I'am able to finish ./configure but when I'm going to do a make
command
it gets an error


Reproduce code:
---
/configure --prefix=/usr/local/php
--with-config-file-path=/usr/local/php/lib
--with-libxml-dir=/usr/local
--with-zlib=/usr/local --with-xpm-dir=/usr/local
--with-mysql=/ramsys_db/mysql4.1 --enable-sigchild
--with-mysqli=/ramsys_db/mysql4.1/bin/mysql_config
--with-apxs2=/usr/local/apache2/bin/apxs  --without-pgsql 
--with-jpeg-dir=/usr/local/lib --with-zlib-dir=/usr/local/lib
--with-gd=/usr/local --enable-mbstring  --enable-exif
--enable-force-cgi-redirect --with-png-dir=/usr/local/lib
--with-curl=/usr/local --with-ldap=/usr/local
--with-openssl=/usr/local/ssl --with-gettext
--with-pcre-dir=/usr/local
--with-freetype-dir=/usr/local/lib --with-mssql=/usr/local/freetds
--with-oci8=instantclient,/oracle/app/oracle/product/10.2.0/instantclien
t_10_2

Actual result:
--
main/internal_functions_cli.lo -lrt -lmysqlclient -lsybdb -lldap
-llber
-liconv -lintl -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lcurl -lz
-lssl -lcrypto -lresolv -lm -lnsl -lsocket -lgcc -lxml2 -lz -liconv
-lm
-lsocket -lnsl -lcurl -lidn -lssl -lcrypto -lrt -lsocket -lnsl -lssl
-lcrypto -lsocket -lnsl -ldl -lz -lxml2 -lz -liconv -lm -lsocket -lnsl
-lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm -lclntsh -lxml2
-lz
-liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl
-lxml2
-lz -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl 
-o
sapi/cli/php
libtool: link: warning: library `/usr/local/lib/libfreetype.la' was
moved.
libtool: link: warning: library `/usr/local/lib/libfreetype.la' was
moved.
ld: fatal: library -lnet: not found
ld: fatal: File processing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `sapi/cli/php'






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



#48861 [Com]: Problem in compiling php on solaris 10 with oracle

2009-07-09 Thread sjoerd-php at linuxonly dot nl
 ID:   48861
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  jpmendoza at pldt dot com dot ph
 Status:   Open
 Bug Type: LDAP related
 Operating System: Solaris 10
 PHP Version:  5.2.10
 New Comment:

Duplicate of #48863.


Previous Comments:


[2009-07-09 01:17:59] jpmendoza at pldt dot com dot ph

Description:

Hi I'm trying to install php on solaris 10 with oracle.
I'am able to finish ./configure but when I'm going to do a make command
it gets an error



Reproduce code:
---
./configure --prefix=/usr/local/php
--with-config-file-path=/usr/local/php/lib --with-libxml-dir=/usr/local
--with-zlib=/usr/local --with-xpm-dir=/usr/local
--with-mysql=/ramsys_db/mysql4.1 --enable-sigchild
--with-mysqli=/ramsys_db/mysql4.1/bin/mysql_config
--with-apxs2=/usr/local/apache2/bin/apxs  --without-pgsql 
--with-jpeg-dir=/usr/local/lib --with-zlib-dir=/usr/local/lib
--with-gd=/usr/local --enable-mbstring  --enable-exif
--enable-force-cgi-redirect --with-png-dir=/usr/local/lib
--with-curl=/usr/local --with-ldap=/usr/local
--with-openssl=/usr/local/ssl --with-gettext --with-pcre-dir=/usr/local
--with-freetype-dir=/usr/local/lib --with-mssql=/usr/local/freetds
--with-oci8=instantclient,/oracle/app/oracle/product/10.2.0/instantclient_10_2

Actual result:
--
main/internal_functions_cli.lo -lrt -lmysqlclient -lsybdb -lldap -llber
-liconv -lintl -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lcurl -lz
-lssl -lcrypto -lresolv -lm -lnsl -lsocket -lgcc -lxml2 -lz -liconv -lm
-lsocket -lnsl -lcurl -lidn -lssl -lcrypto -lrt -lsocket -lnsl -lssl
-lcrypto -lsocket -lnsl -ldl -lz -lxml2 -lz -liconv -lm -lsocket -lnsl
-lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm -lclntsh -lxml2 -lz
-liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl -lxml2
-lz -liconv -lm -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl  -o
sapi/cli/php
libtool: link: warning: library `/usr/local/lib/libfreetype.la' was
moved.
libtool: link: warning: library `/usr/local/lib/libfreetype.la' was
moved.
ld: fatal: library -lnet: not found
ld: fatal: File processing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `sapi/cli/php'





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



#48891 [Com]: command line output problem

2009-07-12 Thread sjoerd-php at linuxonly dot nl
 ID:   48891
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  hunt_inet at yahoo dot com
 Status:   Open
 Bug Type: Output Control
 Operating System: WinXP sp3 (Chinese traditional)
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

The character encoding specifies how bytes are converted to letters.
This is important if you want to output non-ASCII letters. When
outputting to the browser, any character encoding can be used as long as
you tell the browser which one you are using. You can not expect
non-ASCII letters to work in the browser unless you inform the browser
which character encoding you are using, with a HTTP header or 








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



#48888 [Com]: script crashing when running simultaneously

2009-07-12 Thread sjoerd-php at linuxonly dot nl
 ID:   4
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  contact at juzaz dot com
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: Linux 2.6.24-gentoo-r8
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

How do you run these scripts? From the command line or from the
browser?


Previous Comments:


[2009-07-11 17:12:36] contact at juzaz dot com

Description:

When running 2 batch scripts simultaneously, getting weird errors
like:
Fatal error: Call to undefined function substr() in xxx.php on line
125

The problem is obviously not related to the source code as it happens
with built-in functions.

It also happens with custom class functions sometimes.

The problem doesn't seem to exist when a single php process is
running.

Unfortunately the problem is not reproductible intentionnally.  The
exact same code and conditions will sometimes work and other times fail.






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



#48890 [Com]: $_POST not working properly

2009-07-12 Thread sjoerd-php at linuxonly dot nl
 ID:   48890
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  kwoznik at poczta dot onet dot pl
 Status:   Open
 Bug Type: *Programming Data Structures
 Operating System: vista
 PHP Version:  5.3.0
 New Comment:

Thank you for your report.

I could not reproduce the bug you describe. How do you test whether
$_POST is empty? Could you please provide a complete code example?


Previous Comments:


[2009-07-11 22:18:44] kwoznik at poczta dot onet dot pl

Description:

when in at least two fields of the HTML form are entered identical data
and the register_globals is set to off, sending the data using method
POST gives the $_POST array empty.

There is no problem when the data are different.

Reproduce code:
---






Expected result:

1. first example
as login entered "test"
as password eneterd "test" 

expected
$_POST['login']=test
$_POST['password']=test

2. second example
as login entered "abcd"
as password eneterd "efgh" 

expected
$_POST['login']=abcd
$_POST['password']=efgh

Actual result:
--
1. first example result - incorrect
$_POST is empty.

1. second example result - data are correct
$_POST['login']=abcd
$_POST['password']=efgh





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



#48895 [Com]: Can't red php files with special characters

2009-07-13 Thread sjoerd-php at linuxonly dot nl
 ID:   48895
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  caiofdeassis at gmail dot com
 Status:   Open
 Bug Type: *Unicode Issues
 Operating System: Windows 7
 PHP Version:  5.3.0
 New Comment:

Thank you for your report.

It seems that you are not reporting a bug, but rather requesting
support. This is not the right place to do that. Please ask your
question in one of the following places:
IRC: irc.freenode.net ##php
Usenet: comp.lang.php, alt.comp.lang.php
Mailing lists: http://www.php.net/mailing-lists.php
Web forum: http://stackoverflow.com/questions/tagged/php


Previous Comments:


[2009-07-12 20:20:45] caiofdeassis at gmail dot com

Description:

I don't know what to do, i tried a lot of things to make PHP read a
simple file with special character like "áéíóú.php", but always give the
same error:

Warning: Unknown: failed to open stream: No such file or directory in
Unknown on line 0

Fatal error: Unknown: Failed opening required
'C:/wamp/www/Site/outros/á.php' (include_path='.;C:\php5\pear') in
Unknown on line 0

Can somebody help me ? :(






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



#48905 [Com]: calling a php script via exec gives 0 as return code not respecting exit.

2009-07-13 Thread sjoerd-php at linuxonly dot nl
 ID:   48905
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  lars dot a dot johansson at se dot atlascopco dot com
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: Linux
 PHP Version:  5.3.0
 New Comment:

Thank you for your report.

exit() can take either a string or an integer as first parameter. An
integer is used as exit code. A string, even if it is numeric, is output
on standard out just before exiting. Thus exit(1) will exit with exit
code 1, whereas exit("1") will print "1" and exit with error code 0.

Because parameters in $argv are strings, you pass a string to exit(),
which is printed. You can verify this by printing $output in bugA1.php.


Previous Comments:


[2009-07-13 14:02:05] lars dot a dot johansson at se dot atlascopco dot
com

Description:

Calling a php bug1B.php via exec gives invalid 0 as return code, when 
picking up 1 from caller when caller is PHP script. You call bug1A.php

from a terminal. - ./bug1A.php

Script bugA1.php invokes bug1B.php via exec() with parameter '1', which

script bug1B.php picks up. It looks like all digits are converted to 0

(zero) if you do not explicit cast $argv[1] to integer.

When you call bug1B from a shell script it works like expected, 
returning 1 as return code.



Reproduce code:
---
#!/home/tooljn/PHP5.3/local/bin/php


#!/home/tooljn/PHP5.3/local/bin/php


Expected result:

return code from bug1B.php rc=1;



Actual result:
--
return code from bug1B.php rc=0;





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



#48906 [Com]: checkdate returns true on false date

2009-07-13 Thread sjoerd-php at linuxonly dot nl
 ID:   48906
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  arno dot zandink at gmail dot com
 Status:   Open
 Bug Type: Date/time related
 Operating System: *
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

Your example code can be summarized as follows:


I would expect this to return true, because January 1st 1980 is a valid
date. Why do you think it is an invalid date?


Previous Comments:


[2009-07-13 19:11:20] arno dot zandink at gmail dot com

Description:

checkdate returns true when the date given is not a valid date

If this is not considered a bug, perhaps adding a waring on the manual
page would be wise 

Reproduce code:
---
---
>From manual page: function.checkdate
---
alert('test');";
$aDate_parts = preg_split("/[\s-]+/", $date);

var_dump(
checkdate(
$aDate_parts[1], // Month
$aDate_parts[0], // Day
$aDate_parts[2] // Year
)
);

?>

Expected result:

I would expect var_dump to print a boolean (false) because the date is
not valid

Actual result:
--
A boolean (true) is returned with a invalid date





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



#48906 [Com]: checkdate returns true on false date

2009-07-14 Thread sjoerd-php at linuxonly dot nl
 ID:   48906
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  arno dot zandink at gmail dot com
 Status:   Open
 Bug Type: Date/time related
 Operating System: *
 PHP Version:  5.3.0
 New Comment:

The function checkdate() takes three integers as arguments. That means
that if you pass it a string, it will be cast to an int. The string
"1980 alert('test');" cast to an int will result in
1980.

So
checkdate("01", "01", "1980 alert('test');")
is equivalent to
checkdate(1, 1, 1980)

This is not a bug in PHP, rather a limitation of checkdate: it assumes
that you pass it numbers. You should check yourself that your input is
numeric.


Previous Comments:


[2009-07-13 20:54:59] arno dot zandink at gmail dot com

hmm, indeed I changed my scripted at the last minute because I got a
deprecated notice.

My first test was as following:
alert('test');";
$aDate_parts = split('-', $date);
print_r($aDate_parts);
var_dump(
checkdate(
$aDate_parts[1], // Month
$aDate_parts[0], // Day
$aDate_parts[2] // Year
)
);

?>

This example will result in the following array:
 01
[1] => 01
[2] => 1980 alert('test');
)

?>

And it will return a boolean (true)

------------

[2009-07-13 19:49:18] sjoerd-php at linuxonly dot nl

Thank you for your bug report.

Your example code can be summarized as follows:


I would expect this to return true, because January 1st 1980 is a valid
date. Why do you think it is an invalid date?



[2009-07-13 19:11:20] arno dot zandink at gmail dot com

Description:

checkdate returns true when the date given is not a valid date

If this is not considered a bug, perhaps adding a waring on the manual
page would be wise 

Reproduce code:
---
---
>From manual page: function.checkdate
---
alert('test');";
$aDate_parts = preg_split("/[\s-]+/", $date);

var_dump(
checkdate(
$aDate_parts[1], // Month
$aDate_parts[0], // Day
$aDate_parts[2] // Year
)
);

?>

Expected result:

I would expect var_dump to print a boolean (false) because the date is
not valid

Actual result:
--
A boolean (true) is returned with a invalid date





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



#48904 [Com]: multiplication by zero problem

2009-07-14 Thread sjoerd-php at linuxonly dot nl
 ID:   48904
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  7willows at dsl dot pipex dot com
 Status:   Open
 Bug Type: Math related
 Operating System: SunOS ts10 5.11 snv_115 i86pc
 PHP Version:  5.2.10
 New Comment:

Thank you for your example, but it is too elaborate. Please show what
the problem is in about 10 to 20 lines of PHP code.


Previous Comments:


[2009-07-13 19:14:26] 7willows at dsl dot pipex dot com

';
 echo 'Multiplication Number Facts to
',$maxnumberfacts,'';
 echo 'Please answer the following questions...';
 echo '';
 echo '';
 for ($a = 0; $a < $count; $a++) {
 switch($operator[$a]) {
 case 'x':
echo '';
echo '';
echo '';
echo ' = ';
echo '';
echo '';
echo "";
break;
 case '/':
echo '';
echo '';
echo '';
echo ' = ';
echo '';
echo '';
echo "";
break;
 }

 }
echo '';

echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
 echo '';
 echo '';
 exit();
  }

  if (isset($_POST['checkanswers'])) {
 $count=$_POST['questions'];
 $maxnumberfacts=$_POST['maxsum'];
 include("edupageheader.php");
 echo '';
 echo 'Multiplication Number Facts to
',$maxnumberfacts.'';
 for ($a=0 ; $a < $count ; $a++) {
 $part1="val1ue" . $a ;
 $part2="val2ue" . $a ;
 $part3="useranswer" . $a ;
 $part4="answer" . $a ;
 $part5="operator" . $a ;
 $value_a=$_POST[$part1];
 $value_b=$_POST[$part2];
 $value_c=$_POST[$part3];
 $value_d=$_POST[$part4];
 $value_e=$_POST[$part5];
 switch($value_e) {
case 'x':
echo "  ",$value_a,"  ",$value_e," 
",$value_b,"   =   ",$value_c,"" ;
break;
case '/':
echo "  ",$value_a,"  ",$value_e," 
",$value_b,"   =   ",$value_c,"" ;
break;
 }

 if ($value_c == $value_d) {
echo "  correct!wrong!  ";
 }
 echo "";
 echo "";
 }
 echo '';
 echo '';
 echo '';
 echo '';
 echo '';
 echo '';
 echo '';
 echo '';
  }
  exit();
?>



[2009-07-13 19:02:25] j...@php.net

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 ,
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.





[2009-07-13 13:51:32] 7willows at dsl dot pipex dot com

Description:

I have a function which is used to assign values into a number of
global arrays. Two of the arrays are assigned values that are generated
using the rand() function. A third array holds the result of the
multiplication. When both first two arrays are assigned a value of 0
(zero), the result of the multiplication is 1 and not 0.

This information is then entered into a html form and presented to the
user and they are asked to enter the results of 

$numfacttest[$a] / $randval[$a] = useranswer

The useranswer is then compared to $answer[$a] which is already
calculated. The problem is that 0 * 0 is returning the answer 1
sometimes.

Reproduce code:
---
function setnumberfacttest($count,$maxnumberfacts) {
   global $numfacttest, $answer, $operator, $randval;
   for ($a=0 ; $a < $count ; $a++) {
   $operator[a]=chr(247);
   $bit1=rand(0,$maxnumberfacts);
   $bit2=rand(0,$maxnumberfacts);
   $numfacttest[$a]=$bit1 * $bit2;
   $randval[$a]=$bit2;
   $answer[$a]=$bit1;
   }

}

Expected result:

Actual Results with hidden value displayed

2 / 1 =  2
0 / 0 =  0
0 / 0 =  0
2 / 2 =  1
4 / 2 =  2
1 / 1 =  1
0 / 0 =  0
0 / 0 =  0
0 / 0 =  0
1 / 1 =  1


Actual result:
--
Actual Results with calculated hidden value displayed

2 / 1 =  2
0 / 0 =  1
0 / 0 =  0
2 / 2 =  1
4 / 2 =  2
1 / 1 =  1
0 / 0 =  1
0 / 0 =  0
0 / 0 =  2
1 / 1 =  1






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



#49208 [Com]: strpos() does not match newlines at the end of $needle

2009-08-10 Thread sjoerd-php at linuxonly dot nl
 ID:   49208
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  emil at nachev dot eu
 Status:   Open
 Bug Type: Strings related
 Operating System: Debian GNU/Linux
 PHP Version:  5.2.10
 New Comment:

Thank you for your report.

I could not reproduce it. I get this instead:
This works: int(30)
This does not: int(31)

Note that you say you get int(33), where I get int(30). Both this and
your example not working can be explained if you have Windows-style line
endings in your file instead of Unix-style line endings. In other words,
you have \r\n at the end of the line instead of \n. If this is the case,
it is not a bug in PHP because middle\n does indeed not occur in the
text.


Previous Comments:


[2009-08-10 10:31:56] emil at nachev dot eu

Description:

If $needle is a string that ends with a newline, strpos() does not find
the string in the $haystack, although it is there.

Reproduce code:
---
$text = <<\n";

$buggy_result = strpos($text, "something in the middle\n");
echo 'This does not: '; var_dump($buggy_result);

Expected result:

I expect matching for both "\nsomething in the middle" and "something
in the middle\n" to return an integer. Matching for "something in the
middle", without the newline, returns int(33) (as expected).


Actual result:
--
I get boolean false when matching for a string with "\n" at the end of
$needle:

This works: int(32) 
This does not: bool(false)





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



#49214 [Com]: Print floating

2009-08-11 Thread sjoerd-php at linuxonly dot nl
 ID:   49214
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  leeja120 at gmail dot com
 Status:   Open
 Bug Type: Output Control
 Operating System: windows xp
 PHP Version:  5.2SVN-2009-08-10 (snap)
 New Comment:

Thank you for your report.

The behavior you describe, although it is somewhat strange, is not a
bug. It is documented:

"If PHP encounters a number beyond the bounds of the integer  type, it
will be interpreted as a float instead."

"The size of a float is platform-dependent, although a maximum of
~1.8e308 with a precision of roughly 14 decimal digits is a common value
(the 64 bit IEEE format)."


Previous Comments:


[2009-08-10 20:49:09] leeja120 at gmail dot com

Description:

Print floating

Reproduce code:
---


Expected result:

946744073709551614

Actual result:
--
94674407370955





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



#49232 [Com]: strtolower and utf-8 charaters with diacritics

2009-08-12 Thread sjoerd-php at linuxonly dot nl
 ID:   49232
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  svecpetr at email dot cz
 Status:   Open
 Bug Type: Recode related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

You can use mb_strtolower() to solve your problem.


Previous Comments:


[2009-08-12 10:41:42] svecpetr at email dot cz

Description:

function strtolower doesn't work good

when try to lower Czech characters (with diacritics) written in utf-8 





Reproduce code:
---
try this

setlocale(LC_ALL, "cs_CZ.utf8");
$str = "ÉÌŠÈØŽÝÁÍÉÓύÚÙ";
echo strtolower($str);

// correct output is: 
//  éìšèøžýáíéóïúù
// but you will see something else



Expected result:

correct function

Actual result:
--
see example above





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



#49231 [Com]: iconv doenst handle iso-8859-15 well

2009-08-12 Thread sjoerd-php at linuxonly dot nl
 ID:   49231
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  jochem dot blok at fasterforward dot nl
 Status:   Open
 Bug Type: ICONV related
 Operating System: Windows XP
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

I was unable to reproduce the problem. Are you sure that PHP outputs
the wrong character? It could be the tool you use to view the output has
a problem displaying the euro character. Try the following code:

echo bin2hex(iconv('utf-8','ISO-8859-15', html_entity_decode('€',
null, 'UTF-8'))); // should output a4.


Previous Comments:


[2009-08-12 10:30:38] jochem dot blok at fasterforward dot nl

Description:

iconv doenst handle iso-8859-15 well. See
http://en.wikipedia.org/wiki/ISO/IEC_8859-15. The reproduce code gives ¤
and that should be €. Its seems that iconv converts to ISO-8859-1

Reproduce code:
---
echo
iconv('utf-8','ISO-8859-15',html_entity_decode(utf8_encode('€'),null,
'UTF-8'));

Expected result:

€

Actual result:
--
¤





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



#49226 [Com]: SoapServer failing on construction (cannot load wsdl)

2009-08-12 Thread sjoerd-php at linuxonly dot nl
 ID:   49226
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  richard at rjharrison dot org
 Status:   Open
 Bug Type: SOAP related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

When you retrieve the WSDL over HTTP, does the Content-Length header
match the length of the WSDL? You can try saving the WSDL to disk and
load that one instead.


Previous Comments:


[2009-08-12 10:52:46] stig dot woxholt at fotoknudsen dot no

We have started porting our soap services from 5.2.x to 5.3 and see the
same problem here.

I have spend quite some time trying to identify the problem, and it
seemes to me that when the wsdl reaches a certain size it stops
working.

Ie. i have a service with 10 exposed methods. When all these methods
are exposed i get an error, same as Richards. If i cut down on the
number of exposed methods, to ie. 3 on the service it works.

This is services that is used in production on the 5.2.x builds, and
works perfectly there.

Looks to me that there might be a bug in the XML parsing of the WSDL
somewhere.



[2009-08-11 19:30:45] richard at rjharrison dot org

Description:

SoapServer is failing on construction. I pass an URL with *valid* WSDL
xml, which is generated automatically.

- If I save the WSDL locally and load from disk it works.
- If I serve the WSDL remotely from a static .xml file it works.
- If I load the WSDL-url in my browser I get a well-formed XML
response.
- I can access the dodgy-wsdl URL via file_get_contents.
- Using 5.2.6 on another machine it works fine.

I inspected the http requests and think it could be related to chunked
encoding (it fails on the chunked encoding response). 

Reproduce code:
---
http://myserver/path?wsdl';
$serv = new SoapServer($url);
?>

I can probably provide a sample url privately.

Expected result:

$serv to be instantiated



Actual result:
--
SOAP-ERROR: Parsing WSDL: Couldn't load from
'http://myserver/path?wsdl' : Premature end of data in tag definitions
line 2


Below are the headers of the response that fails:-

Date: Tue, 11 Aug 2009 19:15:29 GMT
Server: Apache/2.2.8 (Unix) DAV/2 PHP/5.3.0
X-powered-by: PHP/5.3.0
Vary: Accept-Encoding,User-Agent
Connection: close
Transfer-encoding: chunked
Content-type: text/xml





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



#49130 [Com]: sha1_file() returns incorrect/unpredictable values

2009-08-13 Thread sjoerd-php at linuxonly dot nl
 ID:   49130
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  adam at elishome dot org
 Status:   Open
 Bug Type: hash related
 Operating System: freebsd
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

Since I could not reproduce it, I have some questions for you. Can you
reproduce the problem on a system with another OS? Is the output of
php-5.2.10 sha1_file consistent for a given file, or does it give a
different output each time? Can you supply an example file which gives a
wrong hash, with both the good and the wrong hash?


Previous Comments:


[2009-08-01 10:47:26] adam at elishome dot org

Description:

The value returned for the sha1_file() function is not reliable.

The sha1_file function's result in PHP 5.2.10 is not the same as the
sha1 value returned by the freebsd system, or by ruby's sha1 function.

PHP 5.2.9 always returns the correct sha1 values, but 5.2.10 does not. 
It occasionally gets it right, but the large majority of the time it is
incorrect.

Reproduce code:
---
Lookup a file's sha1 value using PHP 5.2.9 using the sha1_file function
(or using freebsd's system function, or using Ruby's sha1 function), and
then compare it to the value returned by PHP 5.2.10's sha1_file
function.

Expected result:

I expect the sha1_file function to return correct values.

Actual result:
--
The values returned by sha1_file were not correct.





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



#49269 [Com]: isset() fails on Iterator object when used inside foreach declaration

2009-08-16 Thread sjoerd-php at linuxonly dot nl
 ID:   49269
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  president at basnetworks dot net
 Status:   Open
 Bug Type: Class/Object related
 Operating System: All
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

I could reproduce the behavior and made a code sample to reproduce it:

first)
{
$this->first = false;
return true;
}
return false;
}
function current() { }
function next() { }
function key() { }
function rewind() { }
}

$array_object = new TestObject();

// Without ternary operator, the foreach is entered
foreach ($array_object as $item)
{
echo "This works.\n";
}

// With ternary operator, the foreach is not entered
foreach ((true ? $array_object : $array_object) as $item)
{
die("Good. Expected behavior.\n");
}
die("Bad. Foreach was skipped.\n");
?>


Previous Comments:


[2009-08-16 01:36:43] president at basnetworks dot net

After further testing, I have found this bug is stranger than it
seems:

foreach ((isset($array_object) ? $array_object : array('1', '2', '3'))
as $item)
{
echo $item;
}

Should either print 'abc' or '123' no matter if isset() is successful
or fails.  It prints neither.  Now I am wondering if it is not isset(),
but the ternary operator that is failing.



[2009-08-16 01:28:52] president at basnetworks dot net

I addition to the reproduce code, the following may help to understand
the bug:

foreach ($array_object as $item)
{
echo $item;
}

Will successfully print "abc", while:

foreach ((isset($array_object) ? $array_object : array()) as $item)
{
echo $item;
}

will not print anything, indicating that isset() is returning false.  I
hope that helps.



[2009-08-16 01:20:32] president at basnetworks dot net

Description:

The function isset() produces an incorrect result when used on an
object that implements the Iterator interface, within a foreach
declaration.

As illustrated below, when used outside of the foreach() declaration,
isset() works as expected in the object that implements Iterator
interface, returning true, causing the output 'true'.

When isset() is used within the foreach() declaration on the same
object, it instead returns false, causing an empty array to be used for
the foreach() loop.

There is no reason the isset() function should return anything
different when used within the foreach() declaration block.

Reproduce code:
---
class NormalClass
{
public $a, $b, $c;

public function __construct()
{
$this->a = 'a';
$this->b = 'b';
$this->c = 'c';
}
}

class ArrayClass implements Iterator
{
private $internal_array;

public function __construct()
{
$this->internal_array = array('a', 'b', 'c');
}

public function key()
{
return key($this->nodes);
}

public function current()
{
return current($this->nodes);
}

public function next()
{
next($this->nodes);
}

public function valid()
{
return (current($this->nodes) !== false) ? true : false;
}

public function rewind()
{
reset($this->nodes);
}
}

$array = array('a', 'b', 'c');
$normal_object = new NormalClass();
$array_object = new ArrayClass();

echo "Array: " . (isset($array) ? 'true' : 'false');
echo "\nNormal Object: " . (isset($normal_object) ? 'true' : 'false');
echo "\nArray Object: " . (isset($array_object) ? 'true' : 'false');

echo "\nArray: ";
foreach ((isset($array) ? $array : array()) as $item)
{
echo $item;
}

echo "\nNormal Object: ";
foreach ((isset($normal_object) ? $normal_object : array()) as $item)
{
echo $item;
}

echo "\nArray Object: ";
foreach ((isset($array_object) ? $array_object : array()) as $item)
{
echo $item;
}

Expected result:

Array: true
Normal Object: true
Array Object: true
Array: abc
Normal Object: abc
Array Object: abc

Actual result:
--
Array: true
Normal Object: true
Array Object: true
Array: abc
Normal Object: abc
Array Object: 





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



#49269 [Com]: isset() fails on Iterator object when used inside foreach declaration

2009-08-16 Thread sjoerd-php at linuxonly dot nl
 ID:   49269
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  president at basnetworks dot net
 Status:   Open
 Bug Type: Class/Object related
 Operating System: All
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

I could reproduce the behavior and made a code sample to reproduce it:

first)
{
$this->first = false;
return true;
}
return false;
}
function current() { }
function next() { }
function key() { }
function rewind() { }
}

$array_object = new TestObject();

// Without ternary operator, the foreach is entered
foreach ($array_object as $item)
{
echo "This works.\n";
}

// With ternary operator, the foreach is not entered
foreach ((true ? $array_object : $array_object) as $item)
{
die("Good. Expected behavior.\n");
}
die("Bad. Foreach was skipped.\n");
?>


Previous Comments:
--------

[2009-08-16 10:52:20] sjoerd-php at linuxonly dot nl

Thank you for your bug report.

I could reproduce the behavior and made a code sample to reproduce it:

first)
{
$this->first = false;
return true;
}
return false;
}
function current() { }
function next() { }
function key() { }
function rewind() { }
}

$array_object = new TestObject();

// Without ternary operator, the foreach is entered
foreach ($array_object as $item)
{
echo "This works.\n";
}

// With ternary operator, the foreach is not entered
foreach ((true ? $array_object : $array_object) as $item)
{
die("Good. Expected behavior.\n");
}
die("Bad. Foreach was skipped.\n");
?>



[2009-08-16 01:36:43] president at basnetworks dot net

After further testing, I have found this bug is stranger than it
seems:

foreach ((isset($array_object) ? $array_object : array('1', '2', '3'))
as $item)
{
echo $item;
}

Should either print 'abc' or '123' no matter if isset() is successful
or fails.  It prints neither.  Now I am wondering if it is not isset(),
but the ternary operator that is failing.



[2009-08-16 01:28:52] president at basnetworks dot net

I addition to the reproduce code, the following may help to understand
the bug:

foreach ($array_object as $item)
{
echo $item;
}

Will successfully print "abc", while:

foreach ((isset($array_object) ? $array_object : array()) as $item)
{
echo $item;
}

will not print anything, indicating that isset() is returning false.  I
hope that helps.



[2009-08-16 01:20:32] president at basnetworks dot net

Description:

The function isset() produces an incorrect result when used on an
object that implements the Iterator interface, within a foreach
declaration.

As illustrated below, when used outside of the foreach() declaration,
isset() works as expected in the object that implements Iterator
interface, returning true, causing the output 'true'.

When isset() is used within the foreach() declaration on the same
object, it instead returns false, causing an empty array to be used for
the foreach() loop.

There is no reason the isset() function should return anything
different when used within the foreach() declaration block.

Reproduce code:
---
class NormalClass
{
public $a, $b, $c;

public function __construct()
{
$this->a = 'a';
$this->b = 'b';
$this->c = 'c';
}
}

class ArrayClass implements Iterator
{
private $internal_array;

public function __construct()
{
$this->internal_array = array('a', 'b', 'c');
}

public function key()
{
return key($this->nodes);
}

public function current()
{
return current($this->nodes);
}

public function next()
{
next($this->nodes);
}

public function valid()
{
return (current($this->nodes) !== false) ? true : false;
}

public function rewind()
{
reset($this->nodes);
}
}

$array = array('a', 'b', 'c');
$normal_object = new NormalClass();
$array_object = new ArrayClass();

echo "Array: " . (isset($array) ? 'tru

#49269 [Com]: isset() fails on Iterator object when used inside foreach declaration

2009-08-16 Thread sjoerd-php at linuxonly dot nl
 ID:   49269
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  president at basnetworks dot net
 Status:   Open
 Bug Type: Class/Object related
 Operating System: All
 PHP Version:  5.3.0
 New Comment:

Note that the Iterator in my previous comment sucks and should not be
used.


Previous Comments:


[2009-08-16 10:53:07] sjoerd-php at linuxonly dot nl

Thank you for your bug report.

I could reproduce the behavior and made a code sample to reproduce it:

first)
{
$this->first = false;
return true;
}
return false;
}
function current() { }
function next() { }
function key() { }
function rewind() { }
}

$array_object = new TestObject();

// Without ternary operator, the foreach is entered
foreach ($array_object as $item)
{
echo "This works.\n";
}

// With ternary operator, the foreach is not entered
foreach ((true ? $array_object : $array_object) as $item)
{
die("Good. Expected behavior.\n");
}
die("Bad. Foreach was skipped.\n");
?>

--------

[2009-08-16 10:52:20] sjoerd-php at linuxonly dot nl

Thank you for your bug report.

I could reproduce the behavior and made a code sample to reproduce it:

first)
{
$this->first = false;
return true;
}
return false;
}
function current() { }
function next() { }
function key() { }
function rewind() { }
}

$array_object = new TestObject();

// Without ternary operator, the foreach is entered
foreach ($array_object as $item)
{
echo "This works.\n";
}

// With ternary operator, the foreach is not entered
foreach ((true ? $array_object : $array_object) as $item)
{
die("Good. Expected behavior.\n");
}
die("Bad. Foreach was skipped.\n");
?>



[2009-08-16 01:36:43] president at basnetworks dot net

After further testing, I have found this bug is stranger than it
seems:

foreach ((isset($array_object) ? $array_object : array('1', '2', '3'))
as $item)
{
echo $item;
}

Should either print 'abc' or '123' no matter if isset() is successful
or fails.  It prints neither.  Now I am wondering if it is not isset(),
but the ternary operator that is failing.



[2009-08-16 01:28:52] president at basnetworks dot net

I addition to the reproduce code, the following may help to understand
the bug:

foreach ($array_object as $item)
{
echo $item;
}

Will successfully print "abc", while:

foreach ((isset($array_object) ? $array_object : array()) as $item)
{
echo $item;
}

will not print anything, indicating that isset() is returning false.  I
hope that helps.



[2009-08-16 01:20:32] president at basnetworks dot net

Description:

The function isset() produces an incorrect result when used on an
object that implements the Iterator interface, within a foreach
declaration.

As illustrated below, when used outside of the foreach() declaration,
isset() works as expected in the object that implements Iterator
interface, returning true, causing the output 'true'.

When isset() is used within the foreach() declaration on the same
object, it instead returns false, causing an empty array to be used for
the foreach() loop.

There is no reason the isset() function should return anything
different when used within the foreach() declaration block.

Reproduce code:
---
class NormalClass
{
public $a, $b, $c;

public function __construct()
{
$this->a = 'a';
$this->b = 'b';
$this->c = 'c';
}
}

class ArrayClass implements Iterator
{
private $internal_array;

public function __construct()
{
$this->internal_array = array('a', 'b', 'c');
}

public function key()
{
return key($this->nodes);
}

public function current()
{
return current($this->nodes);
}

public function next()
{
next($this->nodes);
}

public function valid()
{
return (current($this->nodes) !== false) ? true : false;
}

public function rewind()
{
reset($this->node

#49244 [Com]: Floating point NaN cause garbage characters

2009-08-20 Thread sjoerd-php at linuxonly dot nl
 ID:   49244
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  ronlentjes at yahoo dot com dot au
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Linux Fedora 8
 PHP Version:  5.3.0
 New Comment:

Could reproduce with PHP 5.2.10.


Previous Comments:


[2009-08-14 04:25:22] ronlentjes at yahoo dot com dot au

Perhaps you test it differently than I do. I'll give you the easiest
way to see it happen:

put this in a file called test.php:
---

---

Output will be (bash, Fedora 8, Linux):

# php test.php
---
NaN*A
---

Output for browser will be NaN??? or NaN???F or other variations of
that.

This is reporducable on versions 4.2.2 (crash), 5.2.4, 5.3.0 (as
indicated previously).

I just retried this now.

Cheers,
Ron Lentjes
LC CLS.



[2009-08-13 14:29:39] ras...@php.net

I am unable to reproduce this in neither 5.2 nor 5.3, and Valgrind is
clean on Debian.



[2009-08-13 14:14:51] ronlentjes at yahoo dot com dot au

Description:

This has been an issue since 4.2.2 and still in 5.3.0.

$d = pow (-1.0, 0.3);  // or anything causing NaN
echo "$d\n";
 -> NAN
printf ("%f\n", $d);
(4.2.2) -> crash
(5.2.4) -> NaN
(5.3.0) -> NaN
 (viewed in browser as NaN???)

Two issues here:
Inconsistent display of NAN for echo and NaN for printf.
Output of bogus characters after the 3 letters NaN for printf.

I think you are missing a '\0' null termination after the NaN
characters which probably cause a runaway to crash 4.2.2 but is just
'hanging' in there for the newer versions.

Cheers,
Ron Lentjes
LC CLS.


Reproduce code:
---
$d = pow (-1.0, 0.3);
echo "$d\n";
printf ("%f\n", $d);


Expected result:

NaN
NaN

Actual result:
--
(4.2.2)
NAN
crash

(5.2.4)
NAN
NaN

(5.3.0)
NAN
NaN
  (viewed in browser as NaN???)






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



#47002 [Com]: Fields truncated

2009-08-20 Thread sjoerd-php at linuxonly dot nl
 ID:   47002
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  victorjavierss at live dot com dot mx
 Status:   Open
 Bug Type: dBase related
 Operating System: Windows
 PHP Version:  5.2CVS-2009-01-04 (snap)
 New Comment:

get_dbf_head assumes a max of 1024 fields. Below is a patch which
removes the 1024 limit and resizes the memory buffer if there are more
than 1024 fields.

--- 5.2latest/php5.2-200906261830/ext/dbase/dbf_head.c  2009-01-17
18:45:09.0 +0100
+++ php-5.2.10/ext/dbase/dbf_head.c 2009-08-20 18:37:56.0
+0200
@@ -22,7 +22,7 @@
dbhead_t *dbh;
struct dbf_dhead  dbhead;
dbfield_t *dbf, *cur_f, *tdbf;
-   int ret, nfields, offset, gf_retval;
+   int ret, nfields, offset, gf_retval, cur_f_offset, tdbf_size;
 
if ((dbh = (dbhead_t *)calloc(1, sizeof(dbhead_t))) == NULL)
return NULL;
@@ -46,14 +46,14 @@
dbhead.dbh_date[DBH_DATE_MONTH],
dbhead.dbh_date[DBH_DATE_DAY]);
 
-   /* malloc enough memory for the maximum number of fields:
-  32 * 1024 = 32K dBase5 (for Win) seems to allow that many */
-   tdbf = (dbfield_t *)calloc(1, sizeof(dbfield_t)*1024);
+   /* Although 1024 fields used to be the max, bug 47002 reports more
than 1024 fields. */
+   tdbf_size = 1024;
+   tdbf = (dbfield_t *)calloc(1, sizeof(dbfield_t)*tdbf_size);

offset = 1;
nfields = 0;
gf_retval = 0;
-   for (cur_f = tdbf; gf_retval < 2 && nfields < 1024; cur_f++) {
+   for (cur_f = tdbf; gf_retval < 2; cur_f++) {
gf_retval = get_dbf_field(dbh, cur_f);
 
if (gf_retval < 0) {
@@ -66,6 +66,13 @@
offset += cur_f->db_flen;
nfields++;
}
+   if (nfields >= tdbf_size) {
+   cur_f_offset = cur_f - tdbf;
+   tdbf = realloc(tdbf, sizeof(dbfield_t) * tdbf_size * 2);
+   memset(tdbf + tdbf_size, '\0', tdbf_size);
+   tdbf_size *= 2;
+   cur_f = tdbf + cur_f_offset;
+   }
}
dbh->db_nfields = nfields;


Previous Comments:


[2009-01-13 06:01:04] victorjavierss at live dot com dot mx

I'm guess is dBase IV



[2009-01-13 05:59:39] victorjavierss at live dot com dot mx

Ooops, i got confused with other dbf, that i'm using, but that file is
over 1024 fields and  y need all of them



[2009-01-12 14:09:25] typoon at gmail dot com

Victor,

Are you sure this file has 1625 fields? I opened the file with DBF
Viewer and I only see 1100 fields. Also I changed the logic a little bit
to calculate the number of fields based on the header length and I also
obtain 1100 fields.
Can you please confirm the number of fields in the file? Also, what is
the version of dbase you are using?

Thanks!



[2009-01-11 18:59:51] victorjavierss at live dot com dot mx

Here is one of the DBF's that i'm using:

http://cid-d95738776c6cf0d0.skydrive.live.com/self.aspx/.Public/USAERF07.DBF

as I said it retrieves me 1024 fild instead of 1625



[2009-01-11 18:50:14] typoon at gmail dot com

I was unable to find a free version of dBase so I can't really create
the file here to simulate the issue.
Could you please post a link to a .dbf file with more than 1024 fields
for me please? Put like 3 or 4 records as examples on it, just so I can
do all tests.

Thanks!

Henrique



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

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



#49244 [Com]: Floating point NaN cause garbage characters

2009-08-20 Thread sjoerd-php at linuxonly dot nl
 ID:   49244
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  ronlentjes at yahoo dot com dot au
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Linux Fedora 8
 PHP Version:  5.3.0
 New Comment:

The problem is with calling php_sprintf_appendstring. Its 9th parameter
is not precision, it is length.

Index: ext/standard/formatted_print.c
===
--- ext/standard/formatted_print.c  (revision 287513)
+++ ext/standard/formatted_print.c  (working copy)
@@ -232,14 +232,14 @@
if (zend_isnan(number)) {
is_negative = (number<0);
php_sprintf_appendstring(buffer, pos, size, "NaN", 3, 0, 
padding,
-alignment, 
precision, is_negative, 0, always_sign);
+alignment, 3, 
is_negative, 0, always_sign);
return;
}
 
if (zend_isinf(number)) {
is_negative = (number<0);
php_sprintf_appendstring(buffer, pos, size, "INF", 3, 0, 
padding,
-alignment, 
precision, is_negative, 0, always_sign);
+alignment, 3, 
is_negative, 0, always_sign);
return;
}


Previous Comments:
----

[2009-08-20 11:15:47] sjoerd-php at linuxonly dot nl

Could reproduce with PHP 5.2.10.



[2009-08-14 04:25:22] ronlentjes at yahoo dot com dot au

Perhaps you test it differently than I do. I'll give you the easiest
way to see it happen:

put this in a file called test.php:
---

---

Output will be (bash, Fedora 8, Linux):

# php test.php
---
NaN*A
---

Output for browser will be NaN??? or NaN???F or other variations of
that.

This is reporducable on versions 4.2.2 (crash), 5.2.4, 5.3.0 (as
indicated previously).

I just retried this now.

Cheers,
Ron Lentjes
LC CLS.



[2009-08-13 14:29:39] ras...@php.net

I am unable to reproduce this in neither 5.2 nor 5.3, and Valgrind is
clean on Debian.



[2009-08-13 14:14:51] ronlentjes at yahoo dot com dot au

Description:

This has been an issue since 4.2.2 and still in 5.3.0.

$d = pow (-1.0, 0.3);  // or anything causing NaN
echo "$d\n";
 -> NAN
printf ("%f\n", $d);
(4.2.2) -> crash
(5.2.4) -> NaN
(5.3.0) -> NaN
 (viewed in browser as NaN???)

Two issues here:
Inconsistent display of NAN for echo and NaN for printf.
Output of bogus characters after the 3 letters NaN for printf.

I think you are missing a '\0' null termination after the NaN
characters which probably cause a runaway to crash 4.2.2 but is just
'hanging' in there for the newer versions.

Cheers,
Ron Lentjes
LC CLS.


Reproduce code:
---
$d = pow (-1.0, 0.3);
echo "$d\n";
printf ("%f\n", $d);


Expected result:

NaN
NaN

Actual result:
--
(4.2.2)
NAN
crash

(5.2.4)
NAN
NaN

(5.3.0)
NAN
NaN
  (viewed in browser as NaN???)






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



#49316 [Com]: "Parse Error" not a meaningful/helpful error message

2009-08-21 Thread sjoerd-php at linuxonly dot nl
 ID:   49316
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  mwease at tx dot rr dot com
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: Universal
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

Providing a position within the line may be possible, but may also
confuse things further. Consider the following example:

1 

PHP thinks the error is on line 3 and says unexpected T_ECHO. The error
is actually on line 2, a missing semicolon. PHP could propose things
that are expected, but there are so many things possible that this is
not helpful.

As shown, the linenumber is more of an indication than the real
position. Providing the character on the line would not make much sense,
since PHP does not know for sure that the error is exactly there. I
agree that in some cases it can be helpful.

You describe an example where you forgot the $ for a variable. Like
this:



PHP assumes foo is a constant and it gives a notice about this:
PHP Notice:  Use of undefined constant foo - assumed 'foo' in
/data/home/sjoerd/public_html/svnreps/test/a.php on line 2

If you don't see it, you probably have disabled notices. Enable them
with error_reporting.


Previous Comments:


[2009-08-21 06:38:29] mwease at tx dot rr dot com

Description:

deficiency: an error message saying "parse error" on a given line is
ridiculously insufficient.  the interpreter knows that there is a
problem and MUCH more precisely what the problem is. in some instances,
stating that something is missing or "expected" is helpful, but it is
not believable to me that the real problem cannot be identified so that
the "programmer" can understand what needs to be done to fix the error. 
It's crazy to require the programmer to "parse" the "bad" line of code
manually/humanly to figure out what the problem is when software (this
interpreter) already knows there is a problem, what it is, and has
identified it.  at LEAST provide a postion within the line, saying
something at LEAST like "Expecting something else".

in addition, presuming that some unrecognizable "word" that is, in my
case, actually a variable lacking the "$" in front and just replacing it
with "NULL" and moving on is NOT helpful.  it's almost indifferent to
the suffering! the interpreter should at LEAST say something about it!!

bottom line: DON'T JUST TELL ME THAT THERE IS A PROBLEM ON A PARTICULAR
LINE, TELL ME WHAT THE PROBLEM IS EVERY TIME AND DO NOT ASSUME
ANYTHING






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



#49317 [Com]: The encryption function 'mcrypt_cfb(..)' to failed encrypt password 'Zx57Kl36'

2009-08-21 Thread sjoerd-php at linuxonly dot nl
 ID:   49317
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  jinger dot jiang at autodesk dot com
 Status:   Open
 Bug Type: mcrypt related
 Operating System: Vista, Windows2003
 PHP Version:  5.2.10
 New Comment:

Thank you for your bug report.

In your example, the variable $key is not defined. Although the
behavior you report can still be considered a bug, it only seem to
happen when $key is empty. Supplying a correct key fixes your problem
and is useful from a security point of view.


Previous Comments:


[2009-08-21 07:37:18] jinger dot jiang at autodesk dot com

Description:

I use the function mcrypt_cfb(..,MCRYPT_ENCRYPT,.) to encrypt a
password valued 'Zx57Kl36', then I use mcrypt_cfb(..,MCRYPT_DECRYPT,..)
to decrypt the value, it changed to 'Zx57Kl3'.
I also have tried 'Zx57Kl32', 'Zx57Kl34' and 'Zx57Kl35', these value is
changed to 'Zx57Kl3' too after decrypt. But 'Zx57Kl30', 'Zx57Kl31' etc
are correct after decrypt.



Reproduce code:
---
My code:
//$plain_text can be 'Zx57Kl36' etc.
function encrypt($plain_text) {
$plain_text = trim($plain_text);
$iv = substr(md5($key), 0,mcrypt_get_iv_size
(MCRYPT_CAST_256,MCRYPT_MODE_CFB));
$c_t = mcrypt_cfb (MCRYPT_CAST_256, $key, $plain_text,
MCRYPT_ENCRYPT, $iv);
$ret = trim(chop(base64_encode($c_t)));
return $ret;
}

function decrypt($c_t) {
$c_t =  trim(chop(base64_decode($c_t)));
$iv = substr(md5($key), 0,mcrypt_get_iv_size
(MCRYPT_CAST_256,MCRYPT_MODE_CFB));
$p_t = mcrypt_cfb (MCRYPT_CAST_256, $key, $c_t, MCRYPT_DECRYPT,
$iv);
$ret = trim(chop($p_t));
return $ret;
}


Expected result:

$ret=encrypt('Zx57Kl36');
$ret=decrypt($ret);
then $ret should be 'Zx57Kl36' but not 'Zx57Kl3'.


Actual result:
--
$ret=encrypt('Zx57Kl36');
$ret=decrypt($ret);
$ret equals to 'Zx57Kl3'. It should be 'Zx57Kl36'.







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



#49255 [Com]: PDO fails to insert boolean FALSE to MySQL in prepared statement

2009-08-21 Thread sjoerd-php at linuxonly dot nl
 ID:   49255
 Comment by:   sjoerd-php at linuxonly dot nl
 Reported By:  carysmith at creighton dot edu
 Status:   Open
 Bug Type: PDO related
 Operating System: Windows 2003 Ent.
 PHP Version:  5.2.10
 New Comment:

Thank you for your report.

When PDO replaces question marks in execute(), it does not take the
type of the columns into account. It thus does not know that the
parameter to execute() should be interpreted as a boolean, it simply
replaces question marks by strings. Because the string representation of
false is the empty string, it replaces the question mark by ''.

It makes no sense to change the string representation of false to 0,
because that would give problems on other places in PHP. It makes no
sense to parse the query to determine the type, as this is very hard to
do.

To work around this problem, you should convert the boolean value
yourself. You can do so like this:
$numeric_boolean = (int)$php_boolean;


Previous Comments:


[2009-08-14 15:53:18] carysmith at creighton dot edu

Description:

Before I report the bug, would just like to say that PDO is excellent
and I am enjoying working with it.

The Issue:
When attempting to insert a Boolean FALSE into a MySQL Boolean column,
the insert fails. Inserting a 0 does not. 

The following example code is borrowed from another post which was
similar http://bugs.php.net/bug.php?id=38386 and modified to accommodate
how I am using it.

Reproduce code:
---
prepare( $query);
$createStatement->execute();

// Attempt to insert Boolean records into table - (FALSE insert fails
without error)
$query = 'insert into Testing.test_boolean set TheBoolean = ?;';
$statement = $dbh->prepare( $query);
$statement->execute(array(true));
$statement->execute(array(false));

// However by replacing Boolean with integers does work
$statement->execute(array(1));
$statement->execute(array(0));
?>

Expected result:

4 rows added to the table:

1
0
1
0



Actual result:
--
3 rows added to the table:

1
1
0

Investigation of the MySQL logs shows the Boolean FALSE is inserted as
an empty string '' which fails. Please verify if I am missing something
or this cannot be reproduced. In the meantime I am changing the code to
use numbers instead of Boolean.





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



#49519 [NEW]: Passing tmpfile() to CURLOPT_FILE gives warning

2009-09-10 Thread sjoerd-php at linuxonly dot nl
From: sjoerd-php at linuxonly dot nl
Operating system: 
PHP version:  5.3.0
PHP Bug Type: cURL related
Bug description:  Passing tmpfile() to CURLOPT_FILE gives warning

Description:

Passing a resource created by tmpfile() gives a warning that the resource
is not writable.

Reproduce code:
---


Expected result:

No warning.

Actual result:
--
Warning: curl_setopt(): the provided file handle is not writable in
/Volumes/sjoerd-nfs/public_html/svnreps/test/a.php on line 4


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



#49530 [NEW]: SOAP header only results in function call when document/literal

2009-09-11 Thread sjoerd-php at linuxonly dot nl
From: sjoerd-php at linuxonly dot nl
Operating system: 
PHP version:  5.3.0
PHP Bug Type: SOAP related
Bug description:  SOAP header only results in function call when 
document/literal

Description:

When a SOAP header is sent to a webservice which uses SoapServer, a method
with the same name as the header is called. However, this only happens when
the webservice is document/literal, not when it is rpc/encoded.

Reproduce code:
---
http://pastebin.com/f7b1434d9
} else {
$wsdl = 'rpcencoded.wsdl'; // http://pastebin.com/fe989844
}

$handler = new SoapHandler();
$server = new SoapServer($wsdl);
$server->setObject($handler);
$server->handle();
?>

Expected result:

With both WSDLs, that the HeaderAuthenticate method is called. That is,
the X-Debug header contains "header was called" when the HeaderAuthenticate
header was sent.

Actual result:
--
The HeaderAuthenticate method is only called with document/literal WSDL.

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



#49851 [NEW]: HTTP breaks on long header line

2009-10-12 Thread sjoerd-php at linuxonly dot nl
From: sjoerd-php at linuxonly dot nl
Operating system: Linux 2.6.28 Ubuntu 9.0.4
PHP version:  5.3SVN-2009-10-12 (SVN)
PHP Bug Type: HTTP related
Bug description:  HTTP breaks on long header line

Description:

If a HTTP response contains an header of exactly 1024 characters, the
remaining headers are not parsed and are returned in the output.

Reproduce code:
---
http://localhost/a.php');
?>

a.php:
http://www.google.nl/');
echo "Foo";
?>

Expected result:

The homepage of google.nl.

Actual result:
--
Location: http://www.google.nl
Vary: Accept-Encoding
Content-Length: 3
Connection: close
Content-Type: text/html

Foo

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



#49932 [NEW]: Content-Location header is not overwritten

2009-10-20 Thread sjoerd-php at linuxonly dot nl
From: sjoerd-php at linuxonly dot nl
Operating system: Linux
PHP version:  5.2.11
PHP Bug Type: Apache2 related
Bug description:  Content-Location header is not overwritten

Description:

If you access a script by a name other than its filename, it generates a
Content-Location HTTP header. For example, if you request '/a' instead of
'/a.php', the Content-Location header contains 'a.php'.

If you try to override the Content-Location header in the script, like in
the code example below, the response contains two Content-Location headers.

Reproduce code:
---
http://www.example.org/a.php');
?>

Expected result:

One Content-Location header in result:
Content-Location: http://www.example.org/a.php

Actual result:
--
Two Content-Location headers in result:
Content-Location: a.php
Content-Location: http://www.example.org/a.php

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