#47033 [NEW]: converting binary<->string without charset translating

2009-01-07 Thread lunter at interia dot pl
From: lunter at interia dot pl
Operating system: all
PHP version:  6CVS-2009-01-08 (snap)
PHP Bug Type: Unicode Engine related
Bug description:  converting binary<->string without charset translating

Description:

converting binary<->string without charset translating


Two functions for converting binary<->string without translating charset
needed.
It is very usefull because binary data can consists utf-8 substring, you
need to convert to string type.
Also when you have to see binary representation of utf-8 string, or
operating on it as binaries.


Example 1:

You have (binary)$b. It consists two bytes: 11001110 10110010
Its length in binary representation is two.
It is also valid one-length UTF-8 char(946) (greek small letter beta)
How to conver it ($b) into one-char UTF-8 string??
When we try $u=(string)$b, it gives two-char UTF-8 string.


Example 2:

You have (string)$u UTF-8 one-char string. It consists chr(946) (greek
small letter beta)
Now You have to see two bytes binary representation of this (11001110
10110010).
There is no way to convert it without charset translation...




Reproduce code:
---

; Unicode settings ;


unicode.semantics = off
unicode.runtime_encoding = iso-8859-1
unicode.script_encoding = utf-8
unicode.output_encoding = utf-8
unicode.from_error_mode = U_INVALID_SUBSTITUTE
unicode.from_error_subst_char = 3f




Expected result:

way to converting binary<->string without charset translating



Actual result:
--
no way to converting binary<->string without charset translating




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



#46715 [Opn->Fbk]: Segfault on long sql query in pdo_mysql

2009-01-07 Thread kalle
 ID:   46715
 Updated by:   ka...@php.net
 Reported By:  svoboda at svoon dot net
-Status:   Open
+Status:   Feedback
 Bug Type: PDO related
 Operating System: debian etch
 PHP Version:  5.2CVS-2008-11-29 (snap)
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.




Previous Comments:


[2008-12-07 10:36:15] svoboda at svoon dot net

this bug still remains in 5.2.7 version.
ondrej



[2008-11-29 09:17:18] svoboda at svoon dot net

full source is on the page http://www.tojeono.cz/script/php-bug.phps
ondrej



[2008-11-29 09:16:23] svoboda at svoon dot net

Description:

when use long sql query I get segmentation fault. I use latest zend
framework.
I was trying versions 5.2.6, 5.2 snapshot and 5.3 snapshot, I was
trying to coplime php with mysql version 4.1, 5.0 and 5.1 but still the
same result.

Reproduce code:
---
set_include_path(get_include_path() . PATH_SEPARATOR
. '../../../data/library' . PATH_SEPARATOR
);

require_once('Zend/Loader.php');
Zend_Loader::registerAutoload();


$db = Zend_Db::factory('pdo_mysql',array
('host'=>'xx','username'=>'xx','password'=>'xxx','dbname'=>''));
$db->query("SET NAMES utf8");
$db->query("LONG UPDATE QUERY..."); <- on this line I get segfault
echo 'ok';

full source is on the page. if use shorter sql query the script works
fine.

Expected result:

it should print just ok :)






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



#47015 [Opn->Asn]: Trouble with CDATA for single (not multiple) elements

2009-01-07 Thread felipe
 ID:   47015
 Updated by:   fel...@php.net
 Reported By:  walshes at gmail dot com
-Status:   Open
+Status:   Assigned
 Bug Type: SimpleXML related
 Operating System: Linux
 PHP Version:  5.2.8
-Assigned To:  
+Assigned To:  rrichards


Previous Comments:


[2009-01-06 17:13:01] phpwnd at gmail dot com

The reproduce code is unnecessarily complicated and, I believe,
incorrect. Nodesets/nodes should not be cast as arrays, and if you
don't, it works as expected.

Reproduce code:
---
$raw_xml =
'';

$TopLevel = simplexml_load_string($raw_xml);

foreach ($TopLevel->Cues->CueID as $CueID)
{
echo $CueID, "\n";
}

Expected result:

123

Actual result:
--
123



[2009-01-06 09:27:01] walshes at gmail dot com

Description:

The example below fails to run right.  If there are 2 'CueID' elements,
it works.  If there are 1 or 2 non-CDATA CueID elements, it also works.

Reproduce code:
---
$raw_xml =
'';
$xml = @new SimpleXMLElement($raw_xml);
$cues = (array)$xml->Cues;
$cues = (array)$cues['CueID'];

if ($cues)
{  foreach ($cues as $c)
   {  echo "got $c";
   }
}
else
{  echo "SHE BROKE!";
}

Expected result:

Should print
123

Actual result:
--
SHE BROKE is printed 





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



#47025 [Opn->Bgs]: DirectoryIterator::getSize always returns a value under 4GB

2009-01-07 Thread felipe
 ID:   47025
 Updated by:   fel...@php.net
 Reported By:  bfanger at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Filesystem function related
 Operating System: Mac OS X 10.5.6
 PHP Version:  5.2.8
 New Comment:

It's expected, PHP doesnt works with large files yet. This is an item
in our TODO, thanks.


Previous Comments:


[2009-01-07 11:35:23] bfanger at gmail dot com

Description:

I tried to create a directory listing including the filesize.
But the directory containing a 4.4GB file shows an incorrect filesize
of 400MB

DirectoryIterator::getSize and filesize() have the same (32bit signed
int) problem.

Possible solutions:
1. Use a string (or other datatype) that can contain the filesize. (Bug
#44215)

2. An extra optional parameter: filesize(string $filename, [bool
human_readable = false])



Reproduce code:
---
Using (not-existing) solution 2

$file = "/path/to/4.4GiB.file";
echo filesize($file, true);


Expected result:

4.4G

Actual result:
--
401524051





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



#47031 [Opn->Asn]: DualIterator example uses wrong constants

2009-01-07 Thread felipe
 ID:   47031
 Updated by:   fel...@php.net
 Reported By:  jpetso at gmx dot at
-Status:   Open
+Status:   Assigned
 Bug Type: SPL related
 Operating System: all
 PHP Version:  5.3.0alpha3
-Assigned To:  
+Assigned To:  colder


Previous Comments:


[2009-01-07 19:15:07] jpetso at gmx dot at

Oops, forgot to change the default flags for the constructor, and to
fix up the method docs as well. Here's the improved patch.

--- dualiterator.1.4.inc2009-01-07 19:47:18.0 +0100
+++ dualiterator.fixed.inc  2009-01-07 20:12:59.0 +0100
@@ -23,10 +23,9 @@ class DualIterator implements Iterator
 
const KEY_LHS   = 0x10;
const KEY_RHS   = 0x20;
-   const KEY_ARRAY = 0x30;
const KEY_0 = 0x00;

-   const DEFAULT_FLAGS = 0x33;
+   const DEFAULT_FLAGS = 0x13;

private $lhs;
private $rhs;
@@ -38,8 +37,8 @@ class DualIterator implements Iterator
 * @param rhs   Right Hand Side Iterator
 * @param flags iteration flags
 */
-   function __construct(Iterator $lhs, Iterator $rhs, 
-   $flags = 0x33
/*DualIterator::DEFAULT_FLAGS*/)
+   function __construct(Iterator $lhs, Iterator $rhs,
+   $flags = 0x13
/*DualIterator::DEFAULT_FLAGS*/)
{
$this->lhs   = $lhs;
$this->rhs   = $rhs;
@@ -107,20 +106,18 @@ class DualIterator implements Iterator
}
}
 
-   /** @return current value depending on KEY_* flags
+   /** @return key value depending on KEY_* flags
 */ 
function key()
{
switch($this->flags & 0xF0)
{
default:
-   case self::CURRENT_ARRAY:
-   return array($this->lhs->key(), $this->rhs-
-   case self::CURRENT_LHS:
+   case self::KEY_LHS:
return $this->lhs->key();
-   case self::CURRENT_RHS:
+   case self::KEY_RHS:
return $this->rhs->key();
-   case self::CURRENT_0:
+   case self::KEY_0:
return NULL;
}
}



[2009-01-07 19:04:23] jpetso at gmx dot at

The diff to fix the bug.

--- dualiterator.1.4.inc2009-01-07 19:47:18.0 +0100
+++ dualiterator.fixed.inc  2009-01-07 20:01:31.0 +0100
@@ -23,10 +23,9 @@ class DualIterator implements Iterator
 
const KEY_LHS   = 0x10;
const KEY_RHS   = 0x20;
-   const KEY_ARRAY = 0x30;
const KEY_0 = 0x00;

-   const DEFAULT_FLAGS = 0x33;
+   const DEFAULT_FLAGS = 0x13;

private $lhs;
private $rhs;
@@ -114,13 +113,11 @@ class DualIterator implements Iterator
switch($this->flags & 0xF0)
{
default:
-   case self::CURRENT_ARRAY:
-   return array($this->lhs->key(), $this->rhs-
-   case self::CURRENT_LHS:
+   case self::KEY_LHS:
return $this->lhs->key();
-   case self::CURRENT_RHS:
+   case self::KEY_RHS:
return $this->rhs->key();
-   case self::CURRENT_0:
+   case self::KEY_0:
return NULL;
}
}



[2009-01-07 19:03:29] jpetso at gmx dot at

Description:

Regarding the DualIterator example, current version:
http://cvs.php.net/viewvc.cgi/php-

In its API documentation, the key() method claims to use the
DualIterator::KEY_* constants, but the code makes use of CURRENT_*
instead.

Also, does the *_ARRAY option (which is used by default even for
key()) does not make a lot of sense because arrays cannot be used as
keys at least for foreach loops. (Might work with low-level iterator
usage, but then again keys should probably be *real* keys in any
case.)

It would be nice to have these issues fixed (diff attached further
down).

Related feature request, totally not in scope for this bug report
(sorry): it might be worthwhile to extend the flags to
{CURRENT,KEY}_{LHS,RHS}_{KEY,VALUE} in order to make it possible to
e.g. use the left hand side's current value as key for the iterator.
At least, that's what I'm going to use my derived class for.

Thanks for having a look (and for your work on PHP), regards,
  Jakob

Reproduce code:
---
$leftSideArray = array('lhs_key' => 'lhs_value');
$rightSideArray = array('rhs_key' => 'rhs_value');

$combined = new DualIterator(
  new ArrayIterator($leftSideArray), new
ArrayIterator($rightSideArray),
  DualIterator

#46917 [Opn]: Socket handling completely broken

2009-01-07 Thread felipe
 ID:   46917
 Updated by:   fel...@php.net
 Reported By:  jost_boekemeier at users dot sf dot net
 Status:   Open
 Bug Type: Streams related
 Operating System: *
 PHP Version:  5.2.8
 New Comment:

I changed the EGAIN to EWOULDBLOCK in the checking.

http://news.php.net/php.cvs/55434


Previous Comments:


[2009-01-06 19:51:15] jost_boekemeier at users dot sf dot net

The windows equivalent to EAGAIN is EWOULDBLOCK or WSAEWOULDBLOCK. 

Could it be that EAGAIN is 0 on windows?


Unfortunately I don't have the time and resources to debug this at the
moment.



[2009-01-06 19:15:52] jost_boekemeier at users dot sf dot net

Well, the initialization is okay now.

However, the code still doesn't work on windows. Which means that
there's another bug.

The php_socket_errno() != EAGAIN looks  suspicious.

"Depending on whether your socket is blocking or non-blocking, you 
either get FD_CLOSE notification, or recv() returns 0 (graceful 
disconnection), or recv() returns WSAECONNRESET error."

I don' see how the current code handles these three cases properly.



[2009-01-06 17:41:49] fel...@php.net

Currently the WSASetLastError(0); already exists for Windows in the
code.



[2009-01-06 16:15:20] jost_boekemeier at users dot sf dot net

Hi,

the code is okay for Linux, but on Windows it fails constantly.

+   WSASetLastError(0);
n = select(max_fd + 1, &rset, &wset, &eset, timeout >= 0 ? &tv :
NULL);

IMHO this means that select always returns EAGAIN on windows, so that
the following test cannot detect a broken connection. As I've said, I am
not sure what the EAGAIN test should do, anyway.


To reproduce this: 

1) start a simple socket server on windows >= xp, call pfsockopen() and
let the PHP instance return to the HTTP server's pool w/o closing the
connection

2) kill the socket server and start it again

3) pull the PHP instance from the pool and call pfsockopen() again.
pfsockopen() will use the broken connection until you kill the pool
(i.e.: restart apache or IIS).


Regards,
Jost Bökemeier



[2009-01-03 17:00:01] fel...@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.

I added the Win part minutes ago:
-#ifndef PHP_WIN32
+/* Reseting/initializing */
+#ifdef PHP_WIN32
+   WSASetLastError(0);
+#else
errno = 0;
 #endif

Ok, then, closed. Thanks.



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

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



#33500 [Com]: imap_open() fails when the server advertises GSSAPI

2009-01-07 Thread spryde at aas dot com
 ID:   33500
 Comment by:   spryde at aas dot com
 Reported By:  ed2019 at columbia dot edu
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: RHEL4
 PHP Version:  4.3.10
 New Comment:

Bug still present, 5.2.8, Centos 5.2.


Previous Comments:


[2008-12-07 03:59:17] phalenor at gmail dot com

imap_open() absolutely needs a way to specify the order of
authentication mechanisms to try. If one is attempting to do
username/password auth to an imap server that supports GSSAPI,
imap_open() tries GSSAPI then stops, never attempting to do PLAIN auth
or otherwise. 

This should not be viewed as a misconfiguration of the imap server, as
clients that use c-client manage to try multiple auth mechs.



[2008-10-10 13:36:24] php at eikel dot org

Hello,

this problem still exists in PHP 5.2.6. As stated by Mark Crispin [1]
this problem is probably a bug in the PHP IMAP implementation. Any
suggestions how to fix this problem?

Regards,
Benjamin

[1]
http://mailman2.u.washington.edu/pipermail/imap-uw/2005-June/000101.html



[2008-06-20 15:04:41] josh_barth at hotmail dot com

If you happen to run across this error while attempting to connect to
an Exchange server...  In my case Exchange 2007 from Ubuntu

Install Kerberos client i.e heimdal-client

Switch to the apache userfor Ubuntu that is "www-data":

su www-data

kinit usern...@domainname.com 'Mind the case lo...@upper

klist 'Will show current ticket granting ticket and other tokens

Note: krbtgt will expire and this procedure will need to be repeated I
am currently researching a method to ensure an active krbtgt at all
times

Try testing with this script as the apache user, replacing ipaddress,
username, domainname and password.

Connection Failure!");

echo "Mailboxes\n";
$folders = imap_listmailbox($mbox, "{ipaddress:993}", "*");

if ($folders == false) {
echo "Call failed\n";
} else {
foreach ($folders as $val) {
echo $val . "\n";
}
}

echo "Headers in INBOX\n";
$headers = imap_headers($mbox);

if ($headers == false) {
echo "Call failed\n";
} else {
foreach ($headers as $val) {
echo $val . "\n";
}
}

imap_close($mbox);
?>



[2008-05-26 10:36:17] ruben at dedigate dot com

This issue is also in PHP5 ... there's no way to open an imap/pop
connection to an exchange2007 server that announces GSSAPI :-(



[2007-10-11 09:18:25] tma at gatehouse dot dk

FYI, the same problem appears when trying to use plain-text POP3
authentication against a Microsoft Exchange 2007 server.

IMHO, this is indeed a deficiency in PHP, and the solution is simple:
Expose the uw-imap mail_parameters() function in the PHP API.



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

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



#47029 [Csd]: quoted_printable_decode() produces duplicate warning

2009-01-07 Thread wharmby at uk dot ibm dot com
 ID:   47029
 User updated by:  wharmby at uk dot ibm dot com
 Reported By:  wharmby at uk dot ibm dot com
 Status:   Closed
 Bug Type: Strings related
 Operating System: Windows XP
 PHP Version:  5.3CVS-2009-01-07 (snap)
 New Comment:

Thanks guys. By the time I saw Scott's msg Felipe had applied the patch
to 5.3


Previous Comments:


[2009-01-07 17:22:46] fel...@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-01-07 17:16:20] scott...@php.net

Go ahead and fix this yourself if you have karma.



[2009-01-07 17:04:34] wharmby at uk dot ibm dot com

Description:

Duplicate warning messages issued by quoted_printable_decode () when
invalid input supplied:

Problem only on 5.3; PHP 5.2 and 6 code OK.

Fix is to remove the call to WRONG_PARAM_COUNT on line 206 of
quot_print.c and replace with a "return" as in following patch.

### Eclipse Workspace Patch 1.0
#P php-5.3
Index: ext/standard/quot_print.c
===
RCS file: /repository/php-src/ext/standard/quot_print.c,v
retrieving revision 1.29.2.2.2.1.2.5
diff -u -r1.29.2.2.2.1.2.5 quot_print.c
--- ext/standard/quot_print.c   31 Dec 2008 11:15:45
-   1.29.2.2.2.1.2.5
+++ ext/standard/quot_print.c   7 Jan 2009 16:53:40 -
@@ -203,7 +203,7 @@
int arg1_len, i = 0, j = 0, k;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1,
&arg1_len) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   return;
}
 
if (arg1_len == 0) {



Reproduce code:
---


Expected result:

Warning: quoted_printable_decode() expects exactly 1 parameter, 2 given
in 

#47031 [Com]: DualIterator example uses wrong constants

2009-01-07 Thread jpetso at gmx dot at
 ID:   47031
 Comment by:   jpetso at gmx dot at
 Reported By:  jpetso at gmx dot at
 Status:   Open
 Bug Type: SPL related
 Operating System: all
 PHP Version:  5.3.0alpha3
 New Comment:

Oops, forgot to change the default flags for the constructor, and to
fix up the method docs as well. Here's the improved patch.

--- dualiterator.1.4.inc2009-01-07 19:47:18.0 +0100
+++ dualiterator.fixed.inc  2009-01-07 20:12:59.0 +0100
@@ -23,10 +23,9 @@ class DualIterator implements Iterator
 
const KEY_LHS   = 0x10;
const KEY_RHS   = 0x20;
-   const KEY_ARRAY = 0x30;
const KEY_0 = 0x00;

-   const DEFAULT_FLAGS = 0x33;
+   const DEFAULT_FLAGS = 0x13;

private $lhs;
private $rhs;
@@ -38,8 +37,8 @@ class DualIterator implements Iterator
 * @param rhs   Right Hand Side Iterator
 * @param flags iteration flags
 */
-   function __construct(Iterator $lhs, Iterator $rhs, 
-   $flags = 0x33
/*DualIterator::DEFAULT_FLAGS*/)
+   function __construct(Iterator $lhs, Iterator $rhs,
+   $flags = 0x13
/*DualIterator::DEFAULT_FLAGS*/)
{
$this->lhs   = $lhs;
$this->rhs   = $rhs;
@@ -107,20 +106,18 @@ class DualIterator implements Iterator
}
}
 
-   /** @return current value depending on KEY_* flags
+   /** @return key value depending on KEY_* flags
 */ 
function key()
{
switch($this->flags & 0xF0)
{
default:
-   case self::CURRENT_ARRAY:
-   return array($this->lhs->key(), $this->rhs-
-   case self::CURRENT_LHS:
+   case self::KEY_LHS:
return $this->lhs->key();
-   case self::CURRENT_RHS:
+   case self::KEY_RHS:
return $this->rhs->key();
-   case self::CURRENT_0:
+   case self::KEY_0:
return NULL;
}
}


Previous Comments:


[2009-01-07 19:04:23] jpetso at gmx dot at

The diff to fix the bug.

--- dualiterator.1.4.inc2009-01-07 19:47:18.0 +0100
+++ dualiterator.fixed.inc  2009-01-07 20:01:31.0 +0100
@@ -23,10 +23,9 @@ class DualIterator implements Iterator
 
const KEY_LHS   = 0x10;
const KEY_RHS   = 0x20;
-   const KEY_ARRAY = 0x30;
const KEY_0 = 0x00;

-   const DEFAULT_FLAGS = 0x33;
+   const DEFAULT_FLAGS = 0x13;

private $lhs;
private $rhs;
@@ -114,13 +113,11 @@ class DualIterator implements Iterator
switch($this->flags & 0xF0)
{
default:
-   case self::CURRENT_ARRAY:
-   return array($this->lhs->key(), $this->rhs-
-   case self::CURRENT_LHS:
+   case self::KEY_LHS:
return $this->lhs->key();
-   case self::CURRENT_RHS:
+   case self::KEY_RHS:
return $this->rhs->key();
-   case self::CURRENT_0:
+   case self::KEY_0:
return NULL;
}
}



[2009-01-07 19:03:29] jpetso at gmx dot at

Description:

Regarding the DualIterator example, current version:
http://cvs.php.net/viewvc.cgi/php-

In its API documentation, the key() method claims to use the
DualIterator::KEY_* constants, but the code makes use of CURRENT_*
instead.

Also, does the *_ARRAY option (which is used by default even for
key()) does not make a lot of sense because arrays cannot be used as
keys at least for foreach loops. (Might work with low-level iterator
usage, but then again keys should probably be *real* keys in any
case.)

It would be nice to have these issues fixed (diff attached further
down).

Related feature request, totally not in scope for this bug report
(sorry): it might be worthwhile to extend the flags to
{CURRENT,KEY}_{LHS,RHS}_{KEY,VALUE} in order to make it possible to
e.g. use the left hand side's current value as key for the iterator.
At least, that's what I'm going to use my derived class for.

Thanks for having a look (and for your work on PHP), regards,
  Jakob

Reproduce code:
---
$leftSideArray = array('lhs_key' => 'lhs_value');
$rightSideArray = array('rhs_key' => 'rhs_value');

$combined = new DualIterator(
  new ArrayIterator($leftSideArray), new
ArrayIterator($rightSideArray),
  DualIterator::KEY_LHS | DualIterator::CURRENT_RHS
);

foreach ($combined as $key => $value) {
  var_dump($key);
  var_dump($value);
}

Expected result:

string(7) "lhs_

#47031 [Com]: DualIterator example uses wrong constants

2009-01-07 Thread jpetso at gmx dot at
 ID:   47031
 Comment by:   jpetso at gmx dot at
 Reported By:  jpetso at gmx dot at
 Status:   Open
 Bug Type: SPL related
 Operating System: all
 PHP Version:  5.3.0alpha3
 New Comment:

The diff to fix the bug.

--- dualiterator.1.4.inc2009-01-07 19:47:18.0 +0100
+++ dualiterator.fixed.inc  2009-01-07 20:01:31.0 +0100
@@ -23,10 +23,9 @@ class DualIterator implements Iterator
 
const KEY_LHS   = 0x10;
const KEY_RHS   = 0x20;
-   const KEY_ARRAY = 0x30;
const KEY_0 = 0x00;

-   const DEFAULT_FLAGS = 0x33;
+   const DEFAULT_FLAGS = 0x13;

private $lhs;
private $rhs;
@@ -114,13 +113,11 @@ class DualIterator implements Iterator
switch($this->flags & 0xF0)
{
default:
-   case self::CURRENT_ARRAY:
-   return array($this->lhs->key(), $this->rhs-
-   case self::CURRENT_LHS:
+   case self::KEY_LHS:
return $this->lhs->key();
-   case self::CURRENT_RHS:
+   case self::KEY_RHS:
return $this->rhs->key();
-   case self::CURRENT_0:
+   case self::KEY_0:
return NULL;
}
}


Previous Comments:


[2009-01-07 19:03:29] jpetso at gmx dot at

Description:

Regarding the DualIterator example, current version:
http://cvs.php.net/viewvc.cgi/php-

In its API documentation, the key() method claims to use the
DualIterator::KEY_* constants, but the code makes use of CURRENT_*
instead.

Also, does the *_ARRAY option (which is used by default even for
key()) does not make a lot of sense because arrays cannot be used as
keys at least for foreach loops. (Might work with low-level iterator
usage, but then again keys should probably be *real* keys in any
case.)

It would be nice to have these issues fixed (diff attached further
down).

Related feature request, totally not in scope for this bug report
(sorry): it might be worthwhile to extend the flags to
{CURRENT,KEY}_{LHS,RHS}_{KEY,VALUE} in order to make it possible to
e.g. use the left hand side's current value as key for the iterator.
At least, that's what I'm going to use my derived class for.

Thanks for having a look (and for your work on PHP), regards,
  Jakob

Reproduce code:
---
$leftSideArray = array('lhs_key' => 'lhs_value');
$rightSideArray = array('rhs_key' => 'rhs_value');

$combined = new DualIterator(
  new ArrayIterator($leftSideArray), new
ArrayIterator($rightSideArray),
  DualIterator::KEY_LHS | DualIterator::CURRENT_RHS
);

foreach ($combined as $key => $value) {
  var_dump($key);
  var_dump($value);
}

Expected result:

string(7) "lhs_key"
string(9) "rhs_value"

Actual result:
--
Warning: Illegal type returned from DualIterator::key() in
/home/jakob/dev/www/drupal/6/transformations/sites/all/modules/tf_modu
line 223

Call Stack:
0.0014 112544   1. {main}()
/home/jakob/dev/www/drupal/6/transformations/sites/all/modules/tf_modu

int(0)
string(9) "rhs_value"





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



#47031 [NEW]: DualIterator example uses wrong constants

2009-01-07 Thread jpetso at gmx dot at
From: jpetso at gmx dot at
Operating system: all
PHP version:  5.3.0alpha3
PHP Bug Type: SPL related
Bug description:  DualIterator example uses wrong constants

Description:

Regarding the DualIterator example, current version:
http://cvs.php.net/viewvc.cgi/php-

In its API documentation, the key() method claims to use the
DualIterator::KEY_* constants, but the code makes use of CURRENT_*
instead.

Also, does the *_ARRAY option (which is used by default even for
key()) does not make a lot of sense because arrays cannot be used as
keys at least for foreach loops. (Might work with low-level iterator
usage, but then again keys should probably be *real* keys in any
case.)

It would be nice to have these issues fixed (diff attached further
down).

Related feature request, totally not in scope for this bug report
(sorry): it might be worthwhile to extend the flags to
{CURRENT,KEY}_{LHS,RHS}_{KEY,VALUE} in order to make it possible to
e.g. use the left hand side's current value as key for the iterator.
At least, that's what I'm going to use my derived class for.

Thanks for having a look (and for your work on PHP), regards,
  Jakob

Reproduce code:
---
$leftSideArray = array('lhs_key' => 'lhs_value');
$rightSideArray = array('rhs_key' => 'rhs_value');

$combined = new DualIterator(
  new ArrayIterator($leftSideArray), new ArrayIterator($rightSideArray),
  DualIterator::KEY_LHS | DualIterator::CURRENT_RHS
);

foreach ($combined as $key => $value) {
  var_dump($key);
  var_dump($value);
}

Expected result:

string(7) "lhs_key"
string(9) "rhs_value"

Actual result:
--
Warning: Illegal type returned from DualIterator::key() in
/home/jakob/dev/www/drupal/6/transformations/sites/all/modules/tf_modu
line 223

Call Stack:
0.0014 112544   1. {main}()
/home/jakob/dev/www/drupal/6/transformations/sites/all/modules/tf_modu

int(0)
string(9) "rhs_value"

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



#47030 [Opn->Asn]: SSL context option 'CN_match' useless without 'verify_peer'

2009-01-07 Thread pajoye
 ID:   47030
 Updated by:   paj...@php.net
 Reported By:  a...@php.net
-Status:   Open
+Status:   Assigned
 Bug Type: OpenSSL related
 Operating System: Windows Vista
 PHP Version:  5.2.8
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

I will take a look at that asap.


Previous Comments:


[2009-01-07 17:33:15] a...@php.net

Description:

It is currently impossible to only perform a check that the host name
matches Common Name in SSL certificate. If 'verify_peer' is off, then
the check is not performed, while documentation does not mention that
these context options are dependent.

Note that cURL extension behaves as expected, the script
https://sf.net/');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
if (!curl_exec($ch)) {
echo "Error #" . curl_errno($ch) . ": " . curl_error($ch);
}
?>
outputs the following:
Error #51: SSL: certificate subject name 'sourceforge.net' does not
match target host name 'sf.net'

Reproduce code:
---
$context = stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'CN_match'=> 'sf.net'
)
));
$stream = stream_socket_client('ssl://sf.net:443', $errno, $errstr, 10,
STREAM_CLIENT_CONNECT, $context);
if ($stream) {
echo "Stream connected OK\r\n";
}


Expected result:

Some error message that certificate name 'sourceforge.net' does not
match expected 'sf.net'

Actual result:
--
Stream connected OK





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



#46575 [Opn]: NULL comparison when using "not in" not consistent with Windows SQL

2009-01-07 Thread kalle
 ID:   46575
 Updated by:   ka...@php.net
 Reported By:  ben at thelocust dot org
 Status:   Open
-Bug Type: MSSQL related
+Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  5.2.6
 New Comment:

I don't see the error here, your asking SQL server to return 'test_id'
from the table 'test' where 'test_number' doesn't even to 1 or 2, and
since NULL is different from 1 and 2 then why shouldn't it be returned?
I see that more of a bug in the ASP/VBScript drivers, and I don't think
we should put such an inconsistency into because others do it.

I changed the category of this to a Feature/Change request, letting the
extension maintainer decided whenever to do it or not :)


Previous Comments:


[2008-11-14 16:35:50] ben at thelocust dot org

Description:

When querying a MSSQL database table, and using the "not in" syntax,
PHP's mssql_query will also return rows with NULL in the field
specified.



Reproduce code:
---
SQL Server 2000 or 2005

Table "test"
test_id (int)  test_name (vchar)test_number (int)
1  Foo  1
2  Bar  2
3 3
4  Baz  

$sql = "select test_id from test where test_number not in (1,2)";
$res = mssql_query($sql);
while ($row = mssql_fetch_array($res)) {
?>

http://bugs.php.net/?id=46575&edit=1



#43888 [Opn->Fbk]: mssql_connect fails with an SSL enabled SQL server

2009-01-07 Thread kalle
 ID:   43888
 Updated by:   ka...@php.net
 Reported By:  tank dot is dot hank at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: MSSQL related
 Operating System: Windows 2003
 PHP Version:  5.2.5
 New Comment:

Have you set the mssql.secure_connection ini option to true?


Previous Comments:


[2008-01-18 12:26:42] hack dot is dot tank at gmail dot com

An ODBC connection seems to work, which I believe will fix the problem
for me.



[2008-01-18 09:06:30] tank dot is dot hank at gmail dot com

Description:

mssql_connect stopped working after we enabled SSL on our SQL server.
The only error message we are getting is: 
Warning: mssql_connect(): Unable to connect to: OURSERVER.local in
C:\site\DB.php on line 82

A sniffer shows it is able to open a connection to the server, but
after a couple of seconds the connection is closed. We are able to
connect using SQLCMD.EXE

Reproduce code:
---
mssql_connect('OURSERVER.local', 'myuser', 'mypass');

Actual result:
--
Warning: mssql_connect(): Unable to connect to: OURSERVER.local in
C:\site\DB.php on line 82





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



#47030 [NEW]: SSL context option 'CN_match' useless without 'verify_peer'

2009-01-07 Thread a...@php.net
From: a...@php.net
Operating system: Windows Vista
PHP version:  5.2.8
PHP Bug Type: OpenSSL related
Bug description:  SSL context option 'CN_match' useless without 'verify_peer'

Description:

It is currently impossible to only perform a check that the host name
matches Common Name in SSL certificate. If 'verify_peer' is off, then the
check is not performed, while documentation does not mention that these
context options are dependent.

Note that cURL extension behaves as expected, the script
https://sf.net/');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
if (!curl_exec($ch)) {
echo "Error #" . curl_errno($ch) . ": " . curl_error($ch);
}
?>
outputs the following:
Error #51: SSL: certificate subject name 'sourceforge.net' does not match
target host name 'sf.net'

Reproduce code:
---
$context = stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'CN_match'=> 'sf.net'
)
));
$stream = stream_socket_client('ssl://sf.net:443', $errno, $errstr, 10,
STREAM_CLIENT_CONNECT, $context);
if ($stream) {
echo "Stream connected OK\r\n";
}


Expected result:

Some error message that certificate name 'sourceforge.net' does not match
expected 'sf.net'

Actual result:
--
Stream connected OK

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



#47029 [Opn->Csd]: quoted_printable_decode() produces duplicate warning

2009-01-07 Thread felipe
 ID:   47029
 Updated by:   fel...@php.net
 Reported By:  wharmby at uk dot ibm dot com
-Status:   Open
+Status:   Closed
-Bug Type: Scripting Engine problem
+Bug Type: Strings related
 Operating System: Windows XP
 PHP Version:  5.3CVS-2009-01-07 (snap)
 New Comment:

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.




Previous Comments:


[2009-01-07 17:16:20] scott...@php.net

Go ahead and fix this yourself if you have karma.



[2009-01-07 17:04:34] wharmby at uk dot ibm dot com

Description:

Duplicate warning messages issued by quoted_printable_decode () when
invalid input supplied:

Problem only on 5.3; PHP 5.2 and 6 code OK.

Fix is to remove the call to WRONG_PARAM_COUNT on line 206 of
quot_print.c and replace with a "return" as in following patch.

### Eclipse Workspace Patch 1.0
#P php-5.3
Index: ext/standard/quot_print.c
===
RCS file: /repository/php-src/ext/standard/quot_print.c,v
retrieving revision 1.29.2.2.2.1.2.5
diff -u -r1.29.2.2.2.1.2.5 quot_print.c
--- ext/standard/quot_print.c   31 Dec 2008 11:15:45
-   1.29.2.2.2.1.2.5
+++ ext/standard/quot_print.c   7 Jan 2009 16:53:40 -
@@ -203,7 +203,7 @@
int arg1_len, i = 0, j = 0, k;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1,
&arg1_len) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   return;
}
 
if (arg1_len == 0) {



Reproduce code:
---


Expected result:

Warning: quoted_printable_decode() expects exactly 1 parameter, 2 given
in 

#47029 [Opn]: quoted_printable_decode() produces duplicate warning

2009-01-07 Thread scottmac
 ID:   47029
 Updated by:   scott...@php.net
 Reported By:  wharmby at uk dot ibm dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows XP
 PHP Version:  5.3CVS-2009-01-07 (snap)
 New Comment:

Go ahead and fix this yourself if you have karma.


Previous Comments:


[2009-01-07 17:04:34] wharmby at uk dot ibm dot com

Description:

Duplicate warning messages issued by quoted_printable_decode () when
invalid input supplied:

Problem only on 5.3; PHP 5.2 and 6 code OK.

Fix is to remove the call to WRONG_PARAM_COUNT on line 206 of
quot_print.c and replace with a "return" as in following patch.

### Eclipse Workspace Patch 1.0
#P php-5.3
Index: ext/standard/quot_print.c
===
RCS file: /repository/php-src/ext/standard/quot_print.c,v
retrieving revision 1.29.2.2.2.1.2.5
diff -u -r1.29.2.2.2.1.2.5 quot_print.c
--- ext/standard/quot_print.c   31 Dec 2008 11:15:45
-   1.29.2.2.2.1.2.5
+++ ext/standard/quot_print.c   7 Jan 2009 16:53:40 -
@@ -203,7 +203,7 @@
int arg1_len, i = 0, j = 0, k;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1,
&arg1_len) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   return;
}
 
if (arg1_len == 0) {



Reproduce code:
---


Expected result:

Warning: quoted_printable_decode() expects exactly 1 parameter, 2 given
in 

#47029 [NEW]: quoted_printable_decode() produces duplicate warning

2009-01-07 Thread wharmby at uk dot ibm dot com
From: wharmby at uk dot ibm dot com
Operating system: Windows XP
PHP version:  5.3CVS-2009-01-07 (snap)
PHP Bug Type: Scripting Engine problem
Bug description:  quoted_printable_decode() produces duplicate warning

Description:

Duplicate warning messages issued by quoted_printable_decode () when
invalid input supplied:

Problem only on 5.3; PHP 5.2 and 6 code OK.

Fix is to remove the call to WRONG_PARAM_COUNT on line 206 of quot_print.c
and replace with a "return" as in following patch.

### Eclipse Workspace Patch 1.0
#P php-5.3
Index: ext/standard/quot_print.c
===
RCS file: /repository/php-src/ext/standard/quot_print.c,v
retrieving revision 1.29.2.2.2.1.2.5
diff -u -r1.29.2.2.2.1.2.5 quot_print.c
--- ext/standard/quot_print.c   31 Dec 2008 11:15:45 -  1.29.2.2.2.1.2.5
+++ ext/standard/quot_print.c   7 Jan 2009 16:53:40 -
@@ -203,7 +203,7 @@
int arg1_len, i = 0, j = 0, k;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1,
&arg1_len) == FAILURE) {
-   WRONG_PARAM_COUNT;
+   return;
}
 
if (arg1_len == 0) {



Reproduce code:
---


Expected result:

Warning: quoted_printable_decode() expects exactly 1 parameter, 2 given in

#46044 [Asn->Csd]: Mysqli - wrong error message

2009-01-07 Thread johannes
 ID:   46044
 Updated by:   johan...@php.net
 Reported By:  fel...@php.net
-Status:   Assigned
+Status:   Closed
 Bug Type: MySQLi related
 Operating System: *
 PHP Version:  5.3CVS-2008-09-10 (CVS)
 Assigned To:  mysql
 New Comment:

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.




Previous Comments:


[2008-09-10 17:46:24] fel...@php.net

See also:

new mysqli_stmt(new mysqli('localhost', 'root'));



[2008-09-10 17:41:08] fel...@php.net

Description:

See below.

Reproduce code:
---
new mysqli_result(1); // Error! OK
Warning: mysqli_result::mysqli_result() expects parameter 1 to be
mysqli, integer given in /home/felipe/public_html/bug.php on line 4

new mysqli('localhost', 'root'); // No error, OK!


new mysqli_result(new mysqli('localhost', 'root')); // hm!?!?!?
Warning: mysqli::mysqli() expects parameter 1 to be string, object
given in /home/felipe/public_html/bug.php on line 4






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



#47026 [Bgs]: php_pdo_pgsql.dll don't load

2009-01-07 Thread francois at frinux dot fr
 ID:   47026
 User updated by:  francois at frinux dot fr
 Reported By:  francois at frinux dot fr
 Status:   Bogus
 Bug Type: PostgreSQL related
 Operating System: Windows XP
 PHP Version:  5.2.8
 New Comment:

Like I said, the lib is in my PATH. It is also in the php directory,
and the extension is not loaded.


Previous Comments:


[2009-01-07 13:18:46] paj...@php.net

It is.

Previous versions do not use the libpq.dll as it was statically linked.



[2009-01-07 13:13:50] francois at frinux dot fr

C:\Program Files\PostgreSQL\8.3\bin is in my PATH.
Furthermore, it can't be the proble mbecause all I'm doing is replacing
the 5.2.8 dll by the 5.2.5 one.



[2009-01-07 12:54:08] paj...@php.net

Be sure you have the libpq.dll available in the php dir or in your
path.



[2009-01-07 12:27:45] francois at frinux dot fr

Works also fine with 5.2.5 version of php_pdo_pgsql.dll



[2009-01-07 12:26:49] francois at frinux dot fr

Description:

phpinfo() reveals that there is no PDO drivers :
PDO support enabled
PDO drivers no value

Allthough I enabled them in php.ini:
extension=php_pdo.dll
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll

When I replace php_pdo_pgsql.dll from the 5.2.4 release it works fine.

Expected result:

PDO in phpinfo()
PDO support enabled
PDO drivers pgsql 

Actual result:
--
PDO
PDO support enabled
PDO drivers no value





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



#45228 [Asn]: unlink() & rmdir() do not work well with URL (file://)

2009-01-07 Thread nanawel at eyeos dot org
 ID:   45228
 User updated by:  nanawel at eyeos dot org
 Reported By:  nanawel at eyeos dot org
 Status:   Assigned
 Bug Type: Filesystem function related
 Operating System: *
 PHP Version:  5.2.6
 Assigned To:  pajoze
 New Comment:

Ok, to sum up:

- mkdir()
works with   file://C:/my/pathunder Windows
FAILS with   file:///C:/my/path   under Windows
FAILS with   file://localhost/C:/my/path  under Windows

- rmdir()
FAILS with   ALL file:// schemes  under Windows and Linux

- unlink()
works with   file://C:/my/pathunder Windows
FAILS with   file:///C:/my/path   under Windows
FAILS with   file://localhost/C:/my/path  under Windows

I think I didn't forget anything, hope this helps.


Previous Comments:


[2009-01-07 14:35:41] paj...@php.net

as the report is about both rmdir and unlink, the issue is not windows
specific. Will take care of it.



[2009-01-07 14:27:53] nanawel at eyeos dot org

Except for the rmdir() function which fails on both Windows AND Linux
platforms, all the paths provided in the previous comments are explicite
Windows paths.
You cannot use "C:\" or "C:/" or "file://C:/" or something else under
Linux.

That's why I've just changed the OS concerned by the issue
from: * (all)
to: Windows

Thanks for your time.



[2009-01-07 14:18:50] paj...@php.net

Confusing comments. 

Does unlink work on linux?
Does unlink work on Windows?
Does rmdir work on Windows?
Does rmdir work on Windows?



[2009-01-07 13:58:34] nanawel at eyeos dot org

Just changed the OS concerned by the issue.



[2008-07-14 20:08:57] nanawel at eyeos dot org

Another great one:
rmdir() DOES NOT WORK with the file:// scheme, AT ALL.
Tested on Windows and Ubuntu 8.04 (both on PHP 5.2.6).



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

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



#47027 [Asn->Csd]: var_export doesn't show numeric indices on ArrayObject

2009-01-07 Thread derick
 ID:   47027
 Updated by:   der...@php.net
 Reported By:  dennis at born05 dot nl
-Status:   Assigned
+Status:   Closed
 Bug Type: SPL related
 Operating System: Fedora Core 6
 PHP Version:  5.2.8
 Assigned To:  derick
 New Comment:

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.


Previous Comments:


[2009-01-07 13:50:06] der...@php.net

It's ok... I've a fix which I am just testing.



[2009-01-07 13:31:10] dennis at born05 dot nl

FYI, I have just confirmed the same behaviour in 5.3.0alpha3.



[2009-01-07 12:47:42] dennis at born05 dot nl

Description:

When invoking var_export on an ArrayObject instance it doesn't show 
the numeric indices.

Reproduce code:
---
$ao = new ArrayObject(array (2 => "foo", "bar" => "baz"));
var_export ($ao);

Expected result:

ArrayObject::__set_state(array(
   2 => 'foo',
   'bar' => 'baz',
))

Actual result:
--
ArrayObject::__set_state(array(
   'bar' => 'baz',
))





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



#45228 [Opn->Asn]: unlink() & rmdir() do not work well with URL (file://)

2009-01-07 Thread pajoye
 ID:   45228
 Updated by:   paj...@php.net
 Reported By:  nanawel at eyeos dot org
-Status:   Open
+Status:   Assigned
 Bug Type: Filesystem function related
-Operating System: Windows
+Operating System: *
 PHP Version:  5.2.6
-Assigned To:  
+Assigned To:  pajoze
 New Comment:

as the report is about both rmdir and unlink, the issue is not windows
specific. Will take care of it.


Previous Comments:


[2009-01-07 14:27:53] nanawel at eyeos dot org

Except for the rmdir() function which fails on both Windows AND Linux
platforms, all the paths provided in the previous comments are explicite
Windows paths.
You cannot use "C:\" or "C:/" or "file://C:/" or something else under
Linux.

That's why I've just changed the OS concerned by the issue
from: * (all)
to: Windows

Thanks for your time.



[2009-01-07 14:18:50] paj...@php.net

Confusing comments. 

Does unlink work on linux?
Does unlink work on Windows?
Does rmdir work on Windows?
Does rmdir work on Windows?



[2009-01-07 13:58:34] nanawel at eyeos dot org

Just changed the OS concerned by the issue.



[2008-07-14 20:08:57] nanawel at eyeos dot org

Another great one:
rmdir() DOES NOT WORK with the file:// scheme, AT ALL.
Tested on Windows and Ubuntu 8.04 (both on PHP 5.2.6).



[2008-06-10 16:46:19] nanawel at eyeos dot org

A new set of problems:

- mkdir() only works with file://C:/my/path
  and fails onfile:///C:/my/path
  or  file://localhost/C:/my/path

- rmdir() DOES NOT WORK with file://C:/my/path
  or file:///C:/my/path
  or file://localhost/C:/my/path



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

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



#47028 [NEW]: Strange foreach behavior when using references

2009-01-07 Thread kobieta dot ryba at gmail dot com
From: kobieta dot ryba at gmail dot com
Operating system: Linux
PHP version:  6CVS-2009-01-07 (CVS)
PHP Bug Type: Scripting Engine problem
Bug description:  Strange foreach behavior when using references

Description:

I've noticed strange behavior when using references and foreach loop. 
It throws an error "Invalid argument supplied for foreach" but if the
code
// $ass = &$array;
is commented out, the result is as expected:
Output:
in
in
in


Reproduce code:
---
 &$v)
{
  $array = false;

  $v = "Test";
  echo "in\n";
}
?>

Expected result:

in
in
in


Actual result:
--
in

Warning: Invalid argument supplied for foreach() in test.php on line 5


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



#45228 [Fbk->Opn]: unlink() & rmdir() do not work well with URL (file://)

2009-01-07 Thread nanawel at eyeos dot org
 ID:   45228
 User updated by:  nanawel at eyeos dot org
 Reported By:  nanawel at eyeos dot org
-Status:   Feedback
+Status:   Open
 Bug Type: Filesystem function related
 Operating System: Windows
 PHP Version:  5.2.6
 New Comment:

Except for the rmdir() function which fails on both Windows AND Linux
platforms, all the paths provided in the previous comments are explicite
Windows paths.
You cannot use "C:\" or "C:/" or "file://C:/" or something else under
Linux.

That's why I've just changed the OS concerned by the issue
from: * (all)
to: Windows

Thanks for your time.


Previous Comments:


[2009-01-07 14:18:50] paj...@php.net

Confusing comments. 

Does unlink work on linux?
Does unlink work on Windows?
Does rmdir work on Windows?
Does rmdir work on Windows?



[2009-01-07 13:58:34] nanawel at eyeos dot org

Just changed the OS concerned by the issue.



[2008-07-14 20:08:57] nanawel at eyeos dot org

Another great one:
rmdir() DOES NOT WORK with the file:// scheme, AT ALL.
Tested on Windows and Ubuntu 8.04 (both on PHP 5.2.6).



[2008-06-10 16:46:19] nanawel at eyeos dot org

A new set of problems:

- mkdir() only works with file://C:/my/path
  and fails onfile:///C:/my/path
  or  file://localhost/C:/my/path

- rmdir() DOES NOT WORK with file://C:/my/path
  or file:///C:/my/path
  or file://localhost/C:/my/path



[2008-06-10 16:03:21] nanawel at eyeos dot org

Additionnally, unlink() doesn't work either on URL like:
file://localhost/C:/my/path
and this is particularly _not_ normal.



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

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



#45228 [Opn->Fbk]: unlink() & rmdir() do not work well with URL (file://)

2009-01-07 Thread pajoye
 ID:   45228
 Updated by:   paj...@php.net
 Reported By:  nanawel at eyeos dot org
-Status:   Open
+Status:   Feedback
 Bug Type: Filesystem function related
 Operating System: Windows
 PHP Version:  5.2.6
 New Comment:

Confusing comments. 

Does unlink work on linux?
Does unlink work on Windows?
Does rmdir work on Windows?
Does rmdir work on Windows?


Previous Comments:


[2009-01-07 13:58:34] nanawel at eyeos dot org

Just changed the OS concerned by the issue.



[2008-07-14 20:08:57] nanawel at eyeos dot org

Another great one:
rmdir() DOES NOT WORK with the file:// scheme, AT ALL.
Tested on Windows and Ubuntu 8.04 (both on PHP 5.2.6).



[2008-06-10 16:46:19] nanawel at eyeos dot org

A new set of problems:

- mkdir() only works with file://C:/my/path
  and fails onfile:///C:/my/path
  or  file://localhost/C:/my/path

- rmdir() DOES NOT WORK with file://C:/my/path
  or file:///C:/my/path
  or file://localhost/C:/my/path



[2008-06-10 16:03:21] nanawel at eyeos dot org

Additionnally, unlink() doesn't work either on URL like:
file://localhost/C:/my/path
and this is particularly _not_ normal.



[2008-06-10 15:56:21] nanawel at eyeos dot org

Description:

The unlink() function does not work with full Windows URL, whereas
fopen() for example works perfectly.

If you provide a path like this: file:///C:/my/path
(triple slashes) it won't work and you will get this warning:
Warning: unlink(/C:/my/path) [function.unlink]: Invalid argument in...

But if you provide this path: file://C:/my/path
(so just a slash less) unlink will work.

Reproduce code:
---
//For the example, we consider that PHP has full permissions on
config.sys, which is not the case normally)

$path1 = 'file:///C:/config.sys';
$path2 = 'file://C:/config.sys';

$fp = fopen($path1, 'r');  //OK
@fclose($fp);
unlink($path1);//ERROR

$fp = fopen($path2, 'r');  //OK
@fclose($fp);
unlink($path2);//OK

Expected result:

unlink() should work with the same standards URL as fopen().
In my example, $path1 should be correct for both functions.

Actual result:
--
Windows absolute URL like file:///C:/... work with fopen(), rename()
but _not_ with unlink() (+ Warning raised)

Windows non-standard URL like file://C:/... work with fopen(), rename()
and unlink()





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



#45228 [Opn]: unlink() & rmdir() do not work well with URL (file://)

2009-01-07 Thread nanawel at eyeos dot org
 ID:   45228
 User updated by:  nanawel at eyeos dot org
 Reported By:  nanawel at eyeos dot org
 Status:   Open
 Bug Type: Filesystem function related
-Operating System: *
+Operating System: Windows
 PHP Version:  5.2.6
 New Comment:

Just changed the OS concerned by the issue.


Previous Comments:


[2008-07-14 20:08:57] nanawel at eyeos dot org

Another great one:
rmdir() DOES NOT WORK with the file:// scheme, AT ALL.
Tested on Windows and Ubuntu 8.04 (both on PHP 5.2.6).



[2008-06-10 16:46:19] nanawel at eyeos dot org

A new set of problems:

- mkdir() only works with file://C:/my/path
  and fails onfile:///C:/my/path
  or  file://localhost/C:/my/path

- rmdir() DOES NOT WORK with file://C:/my/path
  or file:///C:/my/path
  or file://localhost/C:/my/path



[2008-06-10 16:03:21] nanawel at eyeos dot org

Additionnally, unlink() doesn't work either on URL like:
file://localhost/C:/my/path
and this is particularly _not_ normal.



[2008-06-10 15:56:21] nanawel at eyeos dot org

Description:

The unlink() function does not work with full Windows URL, whereas
fopen() for example works perfectly.

If you provide a path like this: file:///C:/my/path
(triple slashes) it won't work and you will get this warning:
Warning: unlink(/C:/my/path) [function.unlink]: Invalid argument in...

But if you provide this path: file://C:/my/path
(so just a slash less) unlink will work.

Reproduce code:
---
//For the example, we consider that PHP has full permissions on
config.sys, which is not the case normally)

$path1 = 'file:///C:/config.sys';
$path2 = 'file://C:/config.sys';

$fp = fopen($path1, 'r');  //OK
@fclose($fp);
unlink($path1);//ERROR

$fp = fopen($path2, 'r');  //OK
@fclose($fp);
unlink($path2);//OK

Expected result:

unlink() should work with the same standards URL as fopen().
In my example, $path1 should be correct for both functions.

Actual result:
--
Windows absolute URL like file:///C:/... work with fopen(), rename()
but _not_ with unlink() (+ Warning raised)

Windows non-standard URL like file://C:/... work with fopen(), rename()
and unlink()





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



#47027 [Asn]: var_export doesn't show numeric indices on ArrayObject

2009-01-07 Thread derick
 ID:   47027
 Updated by:   der...@php.net
 Reported By:  dennis at born05 dot nl
 Status:   Assigned
 Bug Type: SPL related
 Operating System: Fedora Core 6
 PHP Version:  5.2.8
 Assigned To:  derick
 New Comment:

It's ok... I've a fix which I am just testing.


Previous Comments:


[2009-01-07 13:31:10] dennis at born05 dot nl

FYI, I have just confirmed the same behaviour in 5.3.0alpha3.



[2009-01-07 12:47:42] dennis at born05 dot nl

Description:

When invoking var_export on an ArrayObject instance it doesn't show 
the numeric indices.

Reproduce code:
---
$ao = new ArrayObject(array (2 => "foo", "bar" => "baz"));
var_export ($ao);

Expected result:

ArrayObject::__set_state(array(
   2 => 'foo',
   'bar' => 'baz',
))

Actual result:
--
ArrayObject::__set_state(array(
   'bar' => 'baz',
))





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



#47027 [Com]: var_export doesn't show numeric indices on ArrayObject

2009-01-07 Thread dennis at born05 dot nl
 ID:   47027
 Comment by:   dennis at born05 dot nl
 Reported By:  dennis at born05 dot nl
 Status:   Assigned
 Bug Type: SPL related
 Operating System: Fedora Core 6
 PHP Version:  5.2.8
 Assigned To:  derick
 New Comment:

FYI, I have just confirmed the same behaviour in 5.3.0alpha3.


Previous Comments:


[2009-01-07 12:47:42] dennis at born05 dot nl

Description:

When invoking var_export on an ArrayObject instance it doesn't show 
the numeric indices.

Reproduce code:
---
$ao = new ArrayObject(array (2 => "foo", "bar" => "baz"));
var_export ($ao);

Expected result:

ArrayObject::__set_state(array(
   2 => 'foo',
   'bar' => 'baz',
))

Actual result:
--
ArrayObject::__set_state(array(
   'bar' => 'baz',
))





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



#47026 [Bgs]: php_pdo_pgsql.dll don't load

2009-01-07 Thread pajoye
 ID:   47026
 Updated by:   paj...@php.net
 Reported By:  francois at frinux dot fr
 Status:   Bogus
 Bug Type: PostgreSQL related
 Operating System: Windows XP
 PHP Version:  5.2.8
 New Comment:

It is.

Previous versions do not use the libpq.dll as it was statically linked.


Previous Comments:


[2009-01-07 13:13:50] francois at frinux dot fr

C:\Program Files\PostgreSQL\8.3\bin is in my PATH.
Furthermore, it can't be the proble mbecause all I'm doing is replacing
the 5.2.8 dll by the 5.2.5 one.



[2009-01-07 12:54:08] paj...@php.net

Be sure you have the libpq.dll available in the php dir or in your
path.



[2009-01-07 12:27:45] francois at frinux dot fr

Works also fine with 5.2.5 version of php_pdo_pgsql.dll



[2009-01-07 12:26:49] francois at frinux dot fr

Description:

phpinfo() reveals that there is no PDO drivers :
PDO support enabled
PDO drivers no value

Allthough I enabled them in php.ini:
extension=php_pdo.dll
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll

When I replace php_pdo_pgsql.dll from the 5.2.4 release it works fine.

Expected result:

PDO in phpinfo()
PDO support enabled
PDO drivers pgsql 

Actual result:
--
PDO
PDO support enabled
PDO drivers no value





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



#47026 [Bgs]: php_pdo_pgsql.dll don't load

2009-01-07 Thread francois at frinux dot fr
 ID:   47026
 User updated by:  francois at frinux dot fr
 Reported By:  francois at frinux dot fr
 Status:   Bogus
 Bug Type: PostgreSQL related
 Operating System: Windows XP
 PHP Version:  5.2.8
 New Comment:

C:\Program Files\PostgreSQL\8.3\bin is in my PATH.
Furthermore, it can't be the proble mbecause all I'm doing is replacing
the 5.2.8 dll by the 5.2.5 one.


Previous Comments:


[2009-01-07 12:54:08] paj...@php.net

Be sure you have the libpq.dll available in the php dir or in your
path.



[2009-01-07 12:27:45] francois at frinux dot fr

Works also fine with 5.2.5 version of php_pdo_pgsql.dll



[2009-01-07 12:26:49] francois at frinux dot fr

Description:

phpinfo() reveals that there is no PDO drivers :
PDO support enabled
PDO drivers no value

Allthough I enabled them in php.ini:
extension=php_pdo.dll
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll

When I replace php_pdo_pgsql.dll from the 5.2.4 release it works fine.

Expected result:

PDO in phpinfo()
PDO support enabled
PDO drivers pgsql 

Actual result:
--
PDO
PDO support enabled
PDO drivers no value





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



#47026 [Opn->Bgs]: php_pdo_pgsql.dll don't load

2009-01-07 Thread pajoye
 ID:   47026
 Updated by:   paj...@php.net
 Reported By:  francois at frinux dot fr
-Status:   Open
+Status:   Bogus
 Bug Type: PostgreSQL related
 Operating System: Windows XP
 PHP Version:  5.2.8
 New Comment:

Be sure you have the libpq.dll available in the php dir or in your
path.


Previous Comments:


[2009-01-07 12:27:45] francois at frinux dot fr

Works also fine with 5.2.5 version of php_pdo_pgsql.dll



[2009-01-07 12:26:49] francois at frinux dot fr

Description:

phpinfo() reveals that there is no PDO drivers :
PDO support enabled
PDO drivers no value

Allthough I enabled them in php.ini:
extension=php_pdo.dll
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll

When I replace php_pdo_pgsql.dll from the 5.2.4 release it works fine.

Expected result:

PDO in phpinfo()
PDO support enabled
PDO drivers pgsql 

Actual result:
--
PDO
PDO support enabled
PDO drivers no value





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



#47027 [Opn->Asn]: var_export doesn't show numeric indices on ArrayObject

2009-01-07 Thread derick
 ID:   47027
 Updated by:   der...@php.net
 Reported By:  dennis at born05 dot nl
-Status:   Open
+Status:   Assigned
 Bug Type: SPL related
 Operating System: Fedora Core 6
 PHP Version:  5.2.8
-Assigned To:  
+Assigned To:  derick


Previous Comments:


[2009-01-07 12:47:42] dennis at born05 dot nl

Description:

When invoking var_export on an ArrayObject instance it doesn't show 
the numeric indices.

Reproduce code:
---
$ao = new ArrayObject(array (2 => "foo", "bar" => "baz"));
var_export ($ao);

Expected result:

ArrayObject::__set_state(array(
   2 => 'foo',
   'bar' => 'baz',
))

Actual result:
--
ArrayObject::__set_state(array(
   'bar' => 'baz',
))





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



#47027 [NEW]: var_export doesn't show numeric indices on ArrayObject

2009-01-07 Thread dennis at born05 dot nl
From: dennis at born05 dot nl
Operating system: Fedora Core 6
PHP version:  5.2.8
PHP Bug Type: SPL related
Bug description:  var_export doesn't show numeric indices on ArrayObject

Description:

When invoking var_export on an ArrayObject instance it doesn't show 
the numeric indices.

Reproduce code:
---
$ao = new ArrayObject(array (2 => "foo", "bar" => "baz"));
var_export ($ao);

Expected result:

ArrayObject::__set_state(array(
   2 => 'foo',
   'bar' => 'baz',
))

Actual result:
--
ArrayObject::__set_state(array(
   'bar' => 'baz',
))

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



#46764 [Opn->Bgs]: attributes() not working properly after xpath()

2009-01-07 Thread rrichards
 ID:   46764
 Updated by:   rricha...@php.net
 Reported By:  maras3000 at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: SimpleXML related
 Operating System: *
 PHP Version:  5.2.7
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

SimpleXMLElement represents both elements and attributes


Previous Comments:


[2008-12-05 16:33:42] maras3000 at gmail dot com

You're right, that's a typo :)

You are also right about attributes not having attributes. But in this
case value returned by xpath() should be either array of values or false
or sth else, because if you are getting a SimpleXMLElement in which you
have [...@attributes] which contain what you were looking for and not being
able to access them via attributes() method is somewhat wrong IMO.



[2008-12-05 16:08:53] phpwnd at gmail dot com

I think there are two errors in this reproduce code. First, there's a
typo in the innermost foreach, $atribute instead of $attribute.
Secondly, that XPath expression selects attributes (which explains why
attributes() returns NULL, as attributes cannot have attributes),
whereas it should select nodes. This code works as expected:

Reproduce code:
---
$xml = simplexml_load_file('./test.xml');
foreach ($xml->xpath('//*...@attr]') as $node)
{
foreach($node->attributes() as $attribute => $value)
echo $attribute . " = " . (string)$value . "\n";
}



[2008-12-05 14:29:47] maras3000 at gmail dot com

Description:

When looking for list of values of a certain attribute in xml via
xpath() method, the returned SimpleXMLElement object's attributes()
method does not properly return array of attributes.

Reproduce code:
---
test.xml:









index.php:


xpath('//@attr');
foreach($result as $node)
{
var_dump($node);
foreach($node->attributes() as $attribute => $value)
echo $atribute . " = " . (string)$value . "\n";
echo "---\n";
}
?>


Expected result:

object(SimpleXMLElement)#2 (1) {
  ["@attributes"]=>
  array(1) {
["attr"]=>
string(1) "1"
  }
}
attr = 1
---
object(SimpleXMLElement)#3 (1) {
  ["@attributes"]=>
  array(1) {
["attr"]=>
string(1) "2"
  }
}
attr = 2
---
object(SimpleXMLElement)#4 (1) {
  ["@attributes"]=>
  array(1) {
["attr"]=>
string(1) "3"
  }
}
attr = 3
---


Actual result:
--
object(SimpleXMLElement)#2 (1) {
  ["@attributes"]=>
  array(1) {
["attr"]=>
string(1) "1"
  }
}
---
object(SimpleXMLElement)#3 (1) {
  ["@attributes"]=>
  array(1) {
["attr"]=>
string(1) "2"
  }
}
---
object(SimpleXMLElement)#4 (1) {
  ["@attributes"]=>
  array(1) {
["attr"]=>
string(1) "3"
  }
}
---






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



#47026 [Opn]: php_pdo_pgsql.dll don't load

2009-01-07 Thread francois at frinux dot fr
 ID:   47026
 User updated by:  francois at frinux dot fr
 Reported By:  francois at frinux dot fr
 Status:   Open
 Bug Type: PostgreSQL related
 Operating System: Windows XP
 PHP Version:  5.2.8
 New Comment:

Works also fine with 5.2.5 version of php_pdo_pgsql.dll


Previous Comments:


[2009-01-07 12:26:49] francois at frinux dot fr

Description:

phpinfo() reveals that there is no PDO drivers :
PDO support enabled
PDO drivers no value

Allthough I enabled them in php.ini:
extension=php_pdo.dll
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll

When I replace php_pdo_pgsql.dll from the 5.2.4 release it works fine.

Expected result:

PDO in phpinfo()
PDO support enabled
PDO drivers pgsql 

Actual result:
--
PDO
PDO support enabled
PDO drivers no value





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



#47026 [NEW]: php_pdo_pgsql.dll don't load

2009-01-07 Thread francois at frinux dot fr
From: francois at frinux dot fr
Operating system: Windows XP
PHP version:  5.2.8
PHP Bug Type: PostgreSQL related
Bug description:  php_pdo_pgsql.dll don't load

Description:

phpinfo() reveals that there is no PDO drivers :
PDO support enabled
PDO drivers no value

Allthough I enabled them in php.ini:
extension=php_pdo.dll
extension=php_pdo_pgsql.dll
extension=php_pgsql.dll

When I replace php_pdo_pgsql.dll from the 5.2.4 release it works fine.

Expected result:

PDO in phpinfo()
PDO support enabled
PDO drivers pgsql 

Actual result:
--
PDO
PDO support enabled
PDO drivers no value

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



#47025 [NEW]: DirectoryIterator::getSize always returns a value under 4GB

2009-01-07 Thread bfanger at gmail dot com
From: bfanger at gmail dot com
Operating system: Mac OS X 10.5.6
PHP version:  5.2.8
PHP Bug Type: Filesystem function related
Bug description:  DirectoryIterator::getSize always returns a value under 4GB 

Description:

I tried to create a directory listing including the filesize.
But the directory containing a 4.4GB file shows an incorrect filesize of
400MB

DirectoryIterator::getSize and filesize() have the same (32bit signed int)
problem.

Possible solutions:
1. Use a string (or other datatype) that can contain the filesize. (Bug
#44215)

2. An extra optional parameter: filesize(string $filename, [bool
human_readable = false])



Reproduce code:
---
Using (not-existing) solution 2

$file = "/path/to/4.4GiB.file";
echo filesize($file, true);


Expected result:

4.4G

Actual result:
--
401524051

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



#47024 [Opn]: PHP cannot be installed

2009-01-07 Thread pajoye
 ID:   47024
 Updated by:   paj...@php.net
 Reported By:  mikolaj dot kowalski at itexpert dot pl
 Status:   Open
-Bug Type: Reproducible crash
+Bug Type: Windows Installer
 Operating System: Windows 2003
 PHP Version:  5.2.8
 New Comment:

> installer


Previous Comments:


[2009-01-07 09:55:26] mikolaj dot kowalski at itexpert dot pl

Description:

There is a bug in installer VBScript. If Regional settings on windows
has different character as decimal separator i.e. ',' PHP is not able to
execute the script. I found that bug was corrected in 5.2.5 but still
exist in 5.2.8. 
I've changed decimal separator to '.' and now it works.

Expected result:

correct installation






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



#47024 [NEW]: PHP cannot be installed

2009-01-07 Thread mikolaj dot kowalski at itexpert dot pl
From: mikolaj dot kowalski at itexpert dot pl
Operating system: Windows 2003
PHP version:  5.2.8
PHP Bug Type: Reproducible crash
Bug description:  PHP cannot be installed

Description:

There is a bug in installer VBScript. If Regional settings on windows has
different character as decimal separator i.e. ',' PHP is not able to
execute the script. I found that bug was corrected in 5.2.5 but still exist
in 5.2.8. 
I've changed decimal separator to '.' and now it works.

Expected result:

correct installation


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



#47023 [Opn->Fbk]: ZipArchive fails under certain circumstances

2009-01-07 Thread pajoye
 ID:   47023
 Updated by:   paj...@php.net
 Reported By:  cristi at imagis dot ro
-Status:   Open
+Status:   Feedback
 Bug Type: Zip Related
 Operating System: Windows XP SP3
 PHP Version:  5.2.8
 New Comment:

Seems to be the same problem than #46985, which is fixed now.

Please try a snapshot (http://windows.php.net/snapshots/)


Previous Comments:


[2009-01-07 09:24:44] cristi at imagis dot ro

Description:

I am experiencing some problems with ZipArchive, using PHP 5.2.8, with
php_zip supplied with this distribution. I am trying to archive couple
of folders and files using ZipArchive.

If i am replacing php_zip.dll with php_zip.dll from PHP 5.2.6 it works
without problems.

Testing same code using a PHP 5.2.7 installation (with php_zip.dll of
5.2.7) crashes archive also (see Expected Results section).

Reproduce code:
---
class My_ZipArchive extends ZipArchive
{
public function addDir($filename, $localname)
{
// Adds a directory recursivelly, keeping the same structure.
// @param string $filename The path to the file to add.
// @param string $localname Local name inside ZIP archive.

if($localname == NULL || empty($localname))
$localpath = "";
else
{
$localpath = $localname . '/';
$this->addEmptyDir($localname);
}

$iter = new DirectoryIterator($filename);

foreach($iter as $file)
{
// Only zip real files: no dots, no links.
if ($file->isDot() || (!$file->isFile() && 
!$file->isDir())) {
continue;
}

$method = $file->isFile() ? 'addFile' : 'addDir';

echo $file->getPathname().' - '.$method.'';

$this->$method($file->getPathname(), 
$localpath.$file->getFilename());
}
}
}

try
{
//create output archive
$zip = new My_ZipArchive();

$zip->open( 'archive.zip', ZIPARCHIVE::CREATE);

$zip->addDir( 'd:\_Work\test\output', '');

$result = $zip->close();
//finish create output archive
}
catch(Exception $e) {
echo 'Caught exception: ',  $e->getMessage(), "\n";
}

exit($result.'finished');

Expected result:

This code should make a zip with my files.

Actual result:
--
If i have 3 .php files to add them to zip i got a corrupted archive. 

If i remove one of them i got a good zip archive.

If i am opening corrupted archive with a zip utility archive doesn't
seems to have any files within or is reported directly as corrupted. If
i am using a repair tool i got a working archive.





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



#47023 [NEW]: ZipArchive fails under certain circumstances

2009-01-07 Thread cristi at imagis dot ro
From: cristi at imagis dot ro
Operating system: Windows XP SP3
PHP version:  5.2.8
PHP Bug Type: Zip Related
Bug description:  ZipArchive fails under certain circumstances

Description:

I am experiencing some problems with ZipArchive, using PHP 5.2.8, with
php_zip supplied with this distribution. I am trying to archive couple of
folders and files using ZipArchive.

If i am replacing php_zip.dll with php_zip.dll from PHP 5.2.6 it works
without problems.

Testing same code using a PHP 5.2.7 installation (with php_zip.dll of
5.2.7) crashes archive also (see Expected Results section).

Reproduce code:
---
class My_ZipArchive extends ZipArchive
{
public function addDir($filename, $localname)
{
// Adds a directory recursivelly, keeping the same structure.
// @param string $filename The path to the file to add.
// @param string $localname Local name inside ZIP archive.

if($localname == NULL || empty($localname))
$localpath = "";
else
{
$localpath = $localname . '/';
$this->addEmptyDir($localname);
}

$iter = new DirectoryIterator($filename);

foreach($iter as $file)
{
// Only zip real files: no dots, no links.
if ($file->isDot() || (!$file->isFile() && 
!$file->isDir())) {
continue;
}

$method = $file->isFile() ? 'addFile' : 'addDir';

echo $file->getPathname().' - '.$method.'';

$this->$method($file->getPathname(), 
$localpath.$file->getFilename());
}
}
}

try
{
//create output archive
$zip = new My_ZipArchive();

$zip->open( 'archive.zip', ZIPARCHIVE::CREATE);

$zip->addDir( 'd:\_Work\test\output', '');

$result = $zip->close();
//finish create output archive
}
catch(Exception $e) {
echo 'Caught exception: ',  $e->getMessage(), "\n";
}

exit($result.'finished');

Expected result:

This code should make a zip with my files.

Actual result:
--
If i have 3 .php files to add them to zip i got a corrupted archive. 

If i remove one of them i got a good zip archive.

If i am opening corrupted archive with a zip utility archive doesn't seems
to have any files within or is reported directly as corrupted. If i am
using a repair tool i got a working archive.

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