#42185 [Fbk->Csd]: Apache-2.2.4 crashes on graceful/restart

2007-08-05 Thread artiom at hotbox dot ru
 ID:   42185
 User updated by:  artiom at hotbox dot ru
 Reported By:  artiom at hotbox dot ru
-Status:   Feedback
+Status:   Closed
 Bug Type: Apache2 related
-Operating System: Freebes 6.0
+Operating System: Freebsd 6.0
 PHP Version:  5.2.3
 New Comment:

Fixed with php5-5.2.3_1


Previous Comments:


[2007-08-02 22:28:41] judas dot iscariote at gmail dot com

not reproducible with apache 2.2.4 , php 5_2 CVS and PCRE 7.2 on linux.



[2007-08-02 19:39:58] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.






[2007-08-02 18:38:46] artiom at hotbox dot ru

Description:

The same thing as the bug #27810. Now on apache 2.2.4 and php 5.2.3.

Reproduce code:
---
- Install apache-2.2.4
- Compile php-5.2.3 with PCRE support using apxs
- run apachectl start
- run apachectl restart or apachectl graceful and apache will die

Expected result:

If I remove the PCRE extention, it works normally.






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


#42210 [NEW]: fputcsv() not consistent to enclose with other than default enclosure value

2007-08-05 Thread nikhil dot gupta at in dot ibm dot com
From: nikhil dot gupta at in dot ibm dot com
Operating system: Linux, Win32-xp
PHP version:  5CVS-2007-08-05 (CVS)
PHP Bug Type: Filesystem function related
Bug description:  fputcsv() not consistent to enclose with other than default 
enclosure value

Description:

fputcsv() is behaving differently with different fields values. A string
provided with a blank space gets enclosed by fputcsv but with other
characters other than space are not enclosed. For details refer to the
reproduce code and expected and actual output.

Reproduce code:
---


Expected result:

int(8)
string(8) "$abc,def$
"
int(10)
string(10) "$abc def$
"

Actual result:
--
int(8)
string(8) "abc,def
"
int(10)
string(10) "$abc def$
"

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


#42211 [NEW]: property_exists() fails to find protected properties from a parent class

2007-08-05 Thread dominics at gmail dot com
From: dominics at gmail dot com
Operating system: Windows/Linux
PHP version:  5.2.4RC1
PHP Bug Type: Class/Object related
Bug description:  property_exists() fails to find protected properties from a 
parent class

Description:

When using property_exists() from a parent class, and checking for the
existence of a protected property in the subclass, property_exists() fails
to find the property.

The documentation for property_exists() says that the property must be
'accessible from the current scope'. In this case, the property _is_,
because A is a parent class and protected visibility is defined in the
documentation as 'limits access to inherited and parent classes'.

As further evidence that protectedBar is accessible from foo(), trying to
manipulate privateBar causes an error, while manipulating protectedBar
doesn't.

Reproduce code:
---
foo();

Expected result:

bool(true) bool(true) bool(false)

Actual result:
--
bool(true) bool(false) bool(false)

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


#42117 [Fbk->Opn]: bzip2.compress loses data in internal buffer

2007-08-05 Thread phofstetter at sensational dot ch
 ID:   42117
 User updated by:  phofstetter at sensational dot ch
 Reported By:  phofstetter at sensational dot ch
-Status:   Feedback
+Status:   Open
 Bug Type: Bzip2 Related
 Operating System: Linux and Mac OSX
 PHP Version:  5.2.3
 New Comment:

Hello,

even with the latest snapshot, the bug is still there. Data in bzip's
internal buffer is lost on stream close due to the problem I discovered
in bz2_filter.c

The patch I proposed blow seems to do the right thing and in fact is
now creating more than 1000 correct bzip2-streams per day, so I think
it's save to say that it really does its job :-)

It's illegal to compare the return code of
BZ2_bzCompress(&(data->strm), BZ_FINISH); with BZ_OUTBUFF_FULL as
BZ2_bzCompress *never* returns BZ_OUTBUFF_FULL (which is a return value
of one of the higher level convenience functions in bzlib.

Philip


Previous Comments:


[2007-08-04 20:56:33] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi





[2007-07-27 10:06:28] phofstetter at sensational dot ch

looking at the documentation wasn't enough. When I looked at the source
of bzlib, I found out this: 

BZ2_bzCompress called with BZ_FINISH keeps returning

BZ_FINISH_OK

(instead of BZ_RUN_OK which I assumed after reading the docs) until
it's really done. Then it will return 

BZ_STREAM_END

So the following patch fixes this bug:

--- bz2_filter.c.orig   2007-07-27 11:24:44.0 +0200
+++ bz2_filter.c2007-07-27 11:54:35.0 +0200
@@ -228,8 +228,8 @@
 
if (flags & PSFS_FLAG_FLUSH_CLOSE) {
/* Spit it out! */
-   status = BZ_OUTBUFF_FULL;
-   while (status == BZ_OUTBUFF_FULL) {
+   status = BZ_FINISH_OK;
+   while (status == BZ_FINISH_OK) {
status = BZ2_bzCompress(&(data->strm),
BZ_FINISH);
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len -
data->strm.avail_out;

With this modification, the complete data gets written out to the
stream.

Please consider applying this patch as without it, the bzip2.compress
filter will sometimes (often - if the data is large enough to be bigger
than the internal buffer) create corrupted data.

Philip
PS: The patch is against 5.2.2 as I'm unable to compile 5.2.3 on OSX
with GD enabled due to gcc being called with an empty -L tag somewhere
in configure.



[2007-07-27 09:21:38] phofstetter at sensational dot ch

after finally getting some sleep, today I looked at the problem in
bz2_filter.c and I may have found something.

On line 229+ we have

if (flags & PSFS_FLAG_FLUSH_CLOSE) {
/* Spit it out! */
status = BZ_OUTBUFF_FULL;
while (status == BZ_OUTBUFF_FULL) {
status = BZ2_bzCompress(&(data->strm), BZ_FINISH);
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;

bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf,
bucketlen), bucketlen, 1, 0 TSRMLS_CC);
php_stream_bucket_append(buckets_out, bucket 
TSRMLS_CC);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
}
}
}

now the problem is IMHO that BZ2_bzCompress with BZ_FINISH will never
return BZ_OUTBUFF_FULL. Looking at the documentation, it will return
BZ_RUN_OK until all data has been processed when it will return
BZ_FINISH_OK.

So with the code as it is currently in PHP, it will only do one run ob
BZ2_bzCompress and then stop working even though more calls could be
needed.

This is consistent with how the bug manifests itself.

I will try to correct the return code handling, but keep in mind that
my C-skills are subpar, so the patch I'm going to post afterwards is
probably not as good as it could be, so please have a look at the
thing.

Philip



[2007-07-26 22:53:50] phofstetter at sensational dot ch

Description:

When bzip2.compress is attached to a stream and enough data is created
so the output will be larger than some internal buffer, all data in the
last not totally full buffer seems to get lost on the way out.

The sample c

#42204 [Opn]: Persistent connections

2007-08-05 Thread jcuello at sitrack dot com
 ID:   42204
 User updated by:  jcuello at sitrack dot com
 Reported By:  jcuello at sitrack dot com
 Status:   Open
 Bug Type: Informix related
-Operating System: Windows XP SP2
+Operating System: Linux, Windows XP
 PHP Version:  4.4.7
 New Comment:

On Linux too.


Previous Comments:


[2007-08-03 20:04:00] jcuello at sitrack dot com

Description:

Every call to ifx_pconnect() opens a connection to the database server
instead of using the connection previously created. This situation take
place when the gap between each call is about 20 seconds or more. We
monitor the connections to the database server with the informix command
'onstat -g ses'. The connections remains open until the apache server is
stopped.


Reproduce code:
---


Expected result:

I expect the script doesn't open a new connection to the database
server if it find a connection already established. I expect it uses the
connection already open.

Actual result:
--
The script open a new connection to the server if the gap between each
call to the script is about 20 seconds or more. The connections remains
open until de apache server is stopped.





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


#42208 [Ver->Csd]: substr_replace() crashes when the same array is passed more than once

2007-08-05 Thread iliaa
 ID:   42208
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Verified
+Status:   Closed
 Bug Type: Reproducible crash
 Operating System: *
 PHP Version:  5CVS-2007-08-04 (CVS)
 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:


[2007-08-05 00:07:34] crrodriguez at suse dot de

--TEST--
#42208  substr_replace() crashes when the same array is passed more
than once
--FILE--

--EXPECT--
array(2) {
  [0]=>
  string(2) "11"
  [1]=>
  string(2) "21"
}

Index: ext/standard/string.c
===
RCS file: /repository/php-src/ext/standard/string.c,v
retrieving revision 1.445.2.14.2.66
diff -u -p -r1.445.2.14.2.66 string.c
--- ext/standard/string.c   30 Jul 2007 14:22:06 - 
1.445.2.14.2.66
+++ ext/standard/string.c   4 Aug 2007 23:45:28 -
@@ -2168,6 +2168,7 @@ PHP_FUNCTION(substr_replace)
}

if (argc > 3) {
+   SEPARATE_ZVAL(len);
if (Z_TYPE_PP(len) != IS_ARRAY) {
convert_to_long_ex(len);
l = Z_LVAL_PP(len);


(status: works for me ;) )



[2007-08-04 20:15:36] [EMAIL PROTECTED]

Thanks to paul at quakenet dot org for finding the crash.



[2007-08-04 20:13:45] [EMAIL PROTECTED]

Description:

substr_replace( subject, replacement, from, len ) is able to accept
arrays for each parameter. However, when any two parameters which are
arrays refer to the same array internally, the function can crash due to
pointer equality.

For the specific case given, substr_replace() reads a value from $a,
performs convert_to_string_ex(), then reads a value from $b and performs
convert_to_long_ex(). Because both arrays refer to the same hashtable,
the code then ends up with a string expected and a long value instead,
and the result is a sometimes-crash.

Reproduce code:
---
$a = array( 1, 2 );
$b = array( 1, 2 ); // creates new hashtable
$c = $a; // bumps refcount on $a, no zval_copy_ctor()
var_dump( substr_replace( $a, 1, 1, $b ) );
var_dump( substr_replace( $a, 1, 1, $c ) );

Expected result:

array(2) {
  [0]=>
  string(2) "11"
  [1]=>
  string(2) "21"
}
array(2) {
  [0]=>
  string(2) "11"
  [1]=>
  string(2) "21"
}


Actual result:
--
array(2) {
  [0]=>
  string(2) "11"
  [1]=>
  string(2) "21"
}
Bus error or Segmentation fault

(gdb) bt
#0  0x00290913 in zif_substr_replace (ht=4, return_value=0x17b4728,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at
/Users/gwynne/src/php-src/php-5cvs/ext/standard/string.c:2341
#1  0x0037c25e in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfffd940) at
/Users/gwynne/src/php-src/php-5cvs/Zend/zend_vm_execute.h:200
#2  0x003825e3 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfffd940) at
/Users/gwynne/src/php-src/php-5cvs/Zend/zend_vm_execute.h:1681
#3  0x0037bd31 in execute (op_array=0x17b360c) at
/Users/gwynne/src/php-src/php-5cvs/Zend/zend_vm_execute.h:92
#4  0x00353829 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /Users/gwynne/src/php-src/php-5cvs/Zend/zend.c:1134
#5  0x002f5378 in php_execute_script (primary_file=0xbfffe058) at
/Users/gwynne/src/php-src/php-5cvs/main/main.c:1794
#6  0x003d6aab in main (argc=2, argv=0xbfffe17c) at
/Users/gwynne/src/php-src/php-5cvs/sapi/cli/php_cli.c:1138






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


#42186 [Bgs]: json_decode() won't work with \l

2007-08-05 Thread djlopez at gmx dot de
 ID:   42186
 User updated by:  djlopez at gmx dot de
 Reported By:  djlopez at gmx dot de
 Status:   Bogus
 Bug Type: JSON related
 Operating System: *
 PHP Version:  5.2.3
 New Comment:

Another "bug":

$json = '{"titel":"Trance","desc":"Trance%0ADJ"}';
var_dump(json_decode(urldecode($json), true));


Afaik %0A is urlencoded for \n. 
json_decode() is returning NULL here also! And this should be a bug...


Previous Comments:


[2007-08-04 14:42:16] djlopez at gmx dot de

I want to remember you, where JSON is used: Javascript - to send data
to the server.

When there's a textarea, some OS/Browser are sending an \l for a
linebreak. So, if an \l is into the string, the _whole_ function won't
work! Sometimes it also appears with an \n, but I can't reproduce this
error. Maybe it has multiple causes.

And as far as I can see, there's no thrown exception to catch this
error. The function json_decode() may be implemented very strictly, but
without an exception, it's very hard to debug the code. 

Please DON'T set this bug to closed!!! Don't ignore the not-that-good
implementation! Thx!



[2007-08-04 14:24:00] [EMAIL PROTECTED]

And according to http://www.json.org/ \l is not in the accepted list of
chars. So no bug here.




[2007-08-04 14:17:56] [EMAIL PROTECTED]

Replace print_r() with var_dump() and you might actually see
something.




[2007-08-02 18:47:06] djlopez at gmx dot de

Description:

json_decode() returns nothing, when the string contains an \l
(lowercase L), maybe (internal) crash!?

Reproduce code:
---
$json = '{"stringwithbreak":"line with a \lbreak!"}';
print_r(json_decode($json, true));


Expected result:

print_r() is NOT returning anything, json_decode() seems to be not
executed.

Actual result:
--
Could be "solved" this way:

print_r(json_decode(str_replace("\\l", "", $json), true));
However, it's a bug...





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


#41528 [Com]: Classes extending ArrayObject do not serialize correctly

2007-08-05 Thread pcdinh at gmail dot com
 ID:   41528
 Comment by:   pcdinh at gmail dot com
 Reported By:  m dot stach at ewerk dot com
 Status:   Assigned
 Bug Type: SPL related
 Operating System: All
 PHP Version:  5.2.2
 Assigned To:  helly
 New Comment:

This bug remain still on PHP 5.2.4RC1


Previous Comments:


[2007-05-29 10:48:09] m dot stach at ewerk dot com

Description:

If a class extends ArrayObject, serializing does not work correctly.
All properties are missing after unserializing, only the array contents
are remain.

ArrayObjects (un)serializes without problems and does not implement the
Serializable interface, so there seems no need to change the
implementation of that interface.

The documentation mentions that it is not possible to serialize objects
of internal class. Since ArrayObject itself serializes fine, I regard
ArrayObject as "non-internal".

May be this is a documentation bug. But this would IMHO limit the broad
use of the ArrayObject class.

Reproduce code:
---
class a extends ArrayObject {
public $a = 2;
}

$a = new a();
$a->a = 1;

var_dump($a);
var_dump($a->a);

$a = unserialize(serialize($a));

var_dump($a);
var_dump($a->a);


Expected result:

object(a)#1 (1) { ["a"]=>  int(1) }
int(1) 

object(a)#1 (1) { ["a"]=>  int(1) } 
int(1) 


Actual result:
--
object(a)#1 (0) { } 
int(1)

object(a)#2 (0) { } 
int(2)





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


#42212 [NEW]: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VAR

2007-08-05 Thread roberto at spadim dot com dot br
From: roberto at spadim dot com dot br
Operating system: linux
PHP version:  5.2.4RC1
PHP Bug Type: Unknown/Other Function
Bug description:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting 
T_STRING or T_VAR

Description:

i will put my source file after
but what happen:
Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718

checking line 718:
$SQL=   "SELECT COUNT(*) FROM est_mov ".
"WHERE ".
"unidade_id=$pde_unidade_id AND ".
"oe_tipo='rp-tr' AND oe=$OT AND ".
"oe_seq=$OT_SEQ AND ".
"item_id=$P[0] AND ".
"item_id_red=$P[1] AND ".
"lote_tipo='$spa_tipo' AND ".
=>  "mov_id=\"". $ARRAY_CONTROLE[  'codigo_barra'  ] ."\" AND ".
"lote_spa=$spa_lote";

if i run this code in a new php file with only this lines everything go
ok, but in my file with others functions don't
i'm wrong? i was using php 5.2.1 on another server and the script run ok,
is it a php.ini problem?

Reproduce code:
---
i will put a file with contents

Expected result:

no problems just execute

Actual result:
--
Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718

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


#42212 [Opn]: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VAR

2007-08-05 Thread roberto at spadim dot com dot br
 ID:   42212
 User updated by:  roberto at spadim dot com dot br
 Reported By:  roberto at spadim dot com dot br
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: linux
 PHP Version:  5.2.4RC1
 New Comment:

get source at:
www.spadim.com.br/source.php.txt


Previous Comments:


[2007-08-05 16:17:56] roberto at spadim dot com dot br

Description:

i will put my source file after
but what happen:
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718

checking line 718:
$SQL=   "SELECT COUNT(*) FROM est_mov ".
"WHERE ".
"unidade_id=$pde_unidade_id AND ".
"oe_tipo='rp-tr' AND oe=$OT AND ".
"oe_seq=$OT_SEQ AND ".
"item_id=$P[0] AND ".
"item_id_red=$P[1] AND ".
"lote_tipo='$spa_tipo' AND ".
=>  "mov_id=\"". $ARRAY_CONTROLE[  'codigo_barra'  ] ."\" AND ".
"lote_spa=$spa_lote";

if i run this code in a new php file with only this lines everything go
ok, but in my file with others functions don't
i'm wrong? i was using php 5.2.1 on another server and the script run
ok, is it a php.ini problem?

Reproduce code:
---
i will put a file with contents

Expected result:

no problems just execute

Actual result:
--
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718





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


#42186 [Bgs]: json_decode() won't work with \l

2007-08-05 Thread scottmac
 ID:   42186
 Updated by:   [EMAIL PROTECTED]
 Reported By:  djlopez at gmx dot de
 Status:   Bogus
 Bug Type: JSON related
 Operating System: *
 PHP Version:  5.2.3
 New Comment:

Thats to be expected.

Newlines need to be escaped as it reads on http://www.json.org/ you can
also read that \l isn't valid.

The grammar is available at http://www.ietf.org/rfc/rfc4627.txt under
Strings if you want a better read.




Previous Comments:


[2007-08-05 15:18:54] djlopez at gmx dot de

Another "bug":

$json = '{"titel":"Trance","desc":"Trance%0ADJ"}';
var_dump(json_decode(urldecode($json), true));


Afaik %0A is urlencoded for \n. 
json_decode() is returning NULL here also! And this should be a bug...



[2007-08-04 14:42:16] djlopez at gmx dot de

I want to remember you, where JSON is used: Javascript - to send data
to the server.

When there's a textarea, some OS/Browser are sending an \l for a
linebreak. So, if an \l is into the string, the _whole_ function won't
work! Sometimes it also appears with an \n, but I can't reproduce this
error. Maybe it has multiple causes.

And as far as I can see, there's no thrown exception to catch this
error. The function json_decode() may be implemented very strictly, but
without an exception, it's very hard to debug the code. 

Please DON'T set this bug to closed!!! Don't ignore the not-that-good
implementation! Thx!



[2007-08-04 14:24:00] [EMAIL PROTECTED]

And according to http://www.json.org/ \l is not in the accepted list of
chars. So no bug here.




[2007-08-04 14:17:56] [EMAIL PROTECTED]

Replace print_r() with var_dump() and you might actually see
something.




[2007-08-02 18:47:06] djlopez at gmx dot de

Description:

json_decode() returns nothing, when the string contains an \l
(lowercase L), maybe (internal) crash!?

Reproduce code:
---
$json = '{"stringwithbreak":"line with a \lbreak!"}';
print_r(json_decode($json, true));


Expected result:

print_r() is NOT returning anything, json_decode() seems to be not
executed.

Actual result:
--
Could be "solved" this way:

print_r(json_decode(str_replace("\\l", "", $json), true));
However, it's a bug...





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


#42212 [Opn->Bgs]: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VAR

2007-08-05 Thread jani
 ID:   42212
 Updated by:   [EMAIL PROTECTED]
 Reported By:  roberto at spadim dot com dot br
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: linux
 PHP Version:  5.2.4RC1
 New Comment:

The extracted piece of code has no parse error in it. 
And the url you posted is not accessible. If there really was some bug
here, we'd really know about it anyway, there's no way something like
this could have passed all regression tests..


Previous Comments:


[2007-08-05 16:20:14] roberto at spadim dot com dot br

get source at:
www.spadim.com.br/source.php.txt



[2007-08-05 16:17:56] roberto at spadim dot com dot br

Description:

i will put my source file after
but what happen:
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718

checking line 718:
$SQL=   "SELECT COUNT(*) FROM est_mov ".
"WHERE ".
"unidade_id=$pde_unidade_id AND ".
"oe_tipo='rp-tr' AND oe=$OT AND ".
"oe_seq=$OT_SEQ AND ".
"item_id=$P[0] AND ".
"item_id_red=$P[1] AND ".
"lote_tipo='$spa_tipo' AND ".
=>  "mov_id=\"". $ARRAY_CONTROLE[  'codigo_barra'  ] ."\" AND ".
"lote_spa=$spa_lote";

if i run this code in a new php file with only this lines everything go
ok, but in my file with others functions don't
i'm wrong? i was using php 5.2.1 on another server and the script run
ok, is it a php.ini problem?

Reproduce code:
---
i will put a file with contents

Expected result:

no problems just execute

Actual result:
--
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718





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


#42117 [Opn]: bzip2.compress loses data in internal buffer

2007-08-05 Thread jani
 ID:   42117
 Updated by:   [EMAIL PROTECTED]
 Reported By:  phofstetter at sensational dot ch
 Status:   Open
 Bug Type: Bzip2 Related
 Operating System: *
 PHP Version:  5.2CVS-2007-08-05
 New Comment:

See also bug #29521



Previous Comments:


[2007-08-05 14:26:35] phofstetter at sensational dot ch

Hello,

even with the latest snapshot, the bug is still there. Data in bzip's
internal buffer is lost on stream close due to the problem I discovered
in bz2_filter.c

The patch I proposed blow seems to do the right thing and in fact is
now creating more than 1000 correct bzip2-streams per day, so I think
it's save to say that it really does its job :-)

It's illegal to compare the return code of
BZ2_bzCompress(&(data->strm), BZ_FINISH); with BZ_OUTBUFF_FULL as
BZ2_bzCompress *never* returns BZ_OUTBUFF_FULL (which is a return value
of one of the higher level convenience functions in bzlib.

Philip



[2007-07-27 10:06:28] phofstetter at sensational dot ch

looking at the documentation wasn't enough. When I looked at the source
of bzlib, I found out this: 

BZ2_bzCompress called with BZ_FINISH keeps returning

BZ_FINISH_OK

(instead of BZ_RUN_OK which I assumed after reading the docs) until
it's really done. Then it will return 

BZ_STREAM_END

So the following patch fixes this bug:

--- bz2_filter.c.orig   2007-07-27 11:24:44.0 +0200
+++ bz2_filter.c2007-07-27 11:54:35.0 +0200
@@ -228,8 +228,8 @@
 
if (flags & PSFS_FLAG_FLUSH_CLOSE) {
/* Spit it out! */
-   status = BZ_OUTBUFF_FULL;
-   while (status == BZ_OUTBUFF_FULL) {
+   status = BZ_FINISH_OK;
+   while (status == BZ_FINISH_OK) {
status = BZ2_bzCompress(&(data->strm),
BZ_FINISH);
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len -
data->strm.avail_out;

With this modification, the complete data gets written out to the
stream.

Please consider applying this patch as without it, the bzip2.compress
filter will sometimes (often - if the data is large enough to be bigger
than the internal buffer) create corrupted data.

Philip
PS: The patch is against 5.2.2 as I'm unable to compile 5.2.3 on OSX
with GD enabled due to gcc being called with an empty -L tag somewhere
in configure.



[2007-07-27 09:21:38] phofstetter at sensational dot ch

after finally getting some sleep, today I looked at the problem in
bz2_filter.c and I may have found something.

On line 229+ we have

if (flags & PSFS_FLAG_FLUSH_CLOSE) {
/* Spit it out! */
status = BZ_OUTBUFF_FULL;
while (status == BZ_OUTBUFF_FULL) {
status = BZ2_bzCompress(&(data->strm), BZ_FINISH);
if (data->strm.avail_out < data->outbuf_len) {
size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;

bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf,
bucketlen), bucketlen, 1, 0 TSRMLS_CC);
php_stream_bucket_append(buckets_out, bucket 
TSRMLS_CC);
data->strm.avail_out = data->outbuf_len;
data->strm.next_out = data->outbuf;
exit_status = PSFS_PASS_ON;
}
}
}

now the problem is IMHO that BZ2_bzCompress with BZ_FINISH will never
return BZ_OUTBUFF_FULL. Looking at the documentation, it will return
BZ_RUN_OK until all data has been processed when it will return
BZ_FINISH_OK.

So with the code as it is currently in PHP, it will only do one run ob
BZ2_bzCompress and then stop working even though more calls could be
needed.

This is consistent with how the bug manifests itself.

I will try to correct the return code handling, but keep in mind that
my C-skills are subpar, so the patch I'm going to post afterwards is
probably not as good as it could be, so please have a look at the
thing.

Philip



[2007-07-26 22:53:50] phofstetter at sensational dot ch

Description:

When bzip2.compress is attached to a stream and enough data is created
so the output will be larger than some internal buffer, all data in the
last not totally full buffer seems to get lost on the way out.

The sample code contains quite a lot of filler text which is needed to
actually fill up the internal buffer full enough to trigger the
problem.

I always had this problem since the stream filters got introduced into
PHP, but now I could finally create a very much reduced 

#42212 [Bgs->Opn]: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VAR

2007-08-05 Thread roberto at spadim dot com dot br
 ID:   42212
 User updated by:  roberto at spadim dot com dot br
 Reported By:  roberto at spadim dot com dot br
-Status:   Bogus
+Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: linux
 PHP Version:  5.2.4RC1
 New Comment:

i put the script again at http
http://www.spadim.com.br/source.php.txt


Previous Comments:


[2007-08-05 16:58:18] [EMAIL PROTECTED]

The extracted piece of code has no parse error in it. 
And the url you posted is not accessible. If there really was some bug
here, we'd really know about it anyway, there's no way something like
this could have passed all regression tests..



[2007-08-05 16:20:14] roberto at spadim dot com dot br

get source at:
www.spadim.com.br/source.php.txt



[2007-08-05 16:17:56] roberto at spadim dot com dot br

Description:

i will put my source file after
but what happen:
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718

checking line 718:
$SQL=   "SELECT COUNT(*) FROM est_mov ".
"WHERE ".
"unidade_id=$pde_unidade_id AND ".
"oe_tipo='rp-tr' AND oe=$OT AND ".
"oe_seq=$OT_SEQ AND ".
"item_id=$P[0] AND ".
"item_id_red=$P[1] AND ".
"lote_tipo='$spa_tipo' AND ".
=>  "mov_id=\"". $ARRAY_CONTROLE[  'codigo_barra'  ] ."\" AND ".
"lote_spa=$spa_lote";

if i run this code in a new php file with only this lines everything go
ok, but in my file with others functions don't
i'm wrong? i was using php 5.2.1 on another server and the script run
ok, is it a php.ini problem?

Reproduce code:
---
i will put a file with contents

Expected result:

no problems just execute

Actual result:
--
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718





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


#29521 [Com]: compress.bzip2 wrapper

2007-08-05 Thread phofstetter at sensational dot ch
 ID:   29521
 Comment by:   phofstetter at sensational dot ch
 Reported By:  [EMAIL PROTECTED]
 Status:   Feedback
 Bug Type: Bzip2 Related
 Operating System: win32 only
 PHP Version:  5.2CVS-2007-01-10
 Assigned To:  iliaa
 New Comment:

Hi,

being the reporter of bug #42117, I think this really is the same thing
and I actually reported a duplicate (terribly sorry for this), though
"my" bug is about the bzip2.compress *filter* where this is about the
stream *wrapper*, but the bug really feels like being the same problem.

Also, the warning is consistent to what I have seen in my case and to
what the incorrect checking of that error code (see #42117) would
cause.

I'm really having my hopes up that this is going to be fixed now :-)

Philip


Previous Comments:


[2007-08-04 21:03:19] [EMAIL PROTECTED]

See bug #42117 which might be the same issue. Nuno, can you try the
patch?




[2007-01-12 22:10:27] [EMAIL PROTECTED]

yep, it still issue the same warning.



[2007-01-12 16:45:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2005-11-17 19:18:23] [EMAIL PROTECTED]

Warning:
fopen(compress.bzip2://http://pt.php.net/backend/notes/all.bz2): failed
to open stream: Invalid argument in C:\Documents and Settings\Nuno\- on
line 3



[2005-07-01 16:08:32] [EMAIL PROTECTED]

Yes, I'm using the binaries from snaps.php.net
BTW, my builds work :) (on cygwin, as I don't have the MSVC)



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

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


#42212 [Com]: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VAR

2007-08-05 Thread mattias at secweb dot se
 ID:   42212
 Comment by:   mattias at secweb dot se
 Reported By:  roberto at spadim dot com dot br
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: linux
 PHP Version:  5.2.4RC1
 New Comment:

This is NOT a bug in PHP.

Check line 698,1


Previous Comments:


[2007-08-05 18:06:03] roberto at spadim dot com dot br

i put the script again at http
http://www.spadim.com.br/source.php.txt



[2007-08-05 16:58:18] [EMAIL PROTECTED]

The extracted piece of code has no parse error in it. 
And the url you posted is not accessible. If there really was some bug
here, we'd really know about it anyway, there's no way something like
this could have passed all regression tests..



[2007-08-05 16:20:14] roberto at spadim dot com dot br

get source at:
www.spadim.com.br/source.php.txt



[2007-08-05 16:17:56] roberto at spadim dot com dot br

Description:

i will put my source file after
but what happen:
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718

checking line 718:
$SQL=   "SELECT COUNT(*) FROM est_mov ".
"WHERE ".
"unidade_id=$pde_unidade_id AND ".
"oe_tipo='rp-tr' AND oe=$OT AND ".
"oe_seq=$OT_SEQ AND ".
"item_id=$P[0] AND ".
"item_id_red=$P[1] AND ".
"lote_tipo='$spa_tipo' AND ".
=>  "mov_id=\"". $ARRAY_CONTROLE[  'codigo_barra'  ] ."\" AND ".
"lote_spa=$spa_lote";

if i run this code in a new php file with only this lines everything go
ok, but in my file with others functions don't
i'm wrong? i was using php 5.2.1 on another server and the script run
ok, is it a php.ini problem?

Reproduce code:
---
i will put a file with contents

Expected result:

no problems just execute

Actual result:
--
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718





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


#42212 [Opn->Bgs]: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VAR

2007-08-05 Thread roberto at spadim dot com dot br
 ID:   42212
 User updated by:  roberto at spadim dot com dot br
 Reported By:  roberto at spadim dot com dot br
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: linux
 PHP Version:  5.2.4RC1
 New Comment:

thanks :) the problem: "`" 698,1
how you found it? 
searching the code, or a program that parse the script and show open
and close of tags like {} `` "" '' () [] ? 
if it's a program, what's the name and where can i get it?

thanks guys, the bug is bogus, and i'm waiting your reply about how to
find parse problems.
please close it after reply, parse is running ok now


Previous Comments:


[2007-08-05 18:27:41] mattias at secweb dot se

This is NOT a bug in PHP.

Check line 698,1



[2007-08-05 18:06:03] roberto at spadim dot com dot br

i put the script again at http
http://www.spadim.com.br/source.php.txt



[2007-08-05 16:58:18] [EMAIL PROTECTED]

The extracted piece of code has no parse error in it. 
And the url you posted is not accessible. If there really was some bug
here, we'd really know about it anyway, there's no way something like
this could have passed all regression tests..



[2007-08-05 16:20:14] roberto at spadim dot com dot br

get source at:
www.spadim.com.br/source.php.txt



[2007-08-05 16:17:56] roberto at spadim dot com dot br

Description:

i will put my source file after
but what happen:
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718

checking line 718:
$SQL=   "SELECT COUNT(*) FROM est_mov ".
"WHERE ".
"unidade_id=$pde_unidade_id AND ".
"oe_tipo='rp-tr' AND oe=$OT AND ".
"oe_seq=$OT_SEQ AND ".
"item_id=$P[0] AND ".
"item_id_red=$P[1] AND ".
"lote_tipo='$spa_tipo' AND ".
=>  "mov_id=\"". $ARRAY_CONTROLE[  'codigo_barra'  ] ."\" AND ".
"lote_spa=$spa_lote";

if i run this code in a new php file with only this lines everything go
ok, but in my file with others functions don't
i'm wrong? i was using php 5.2.1 on another server and the script run
ok, is it a php.ini problem?

Reproduce code:
---
i will put a file with contents

Expected result:

no problems just execute

Actual result:
--
Parse error:  syntax error, unexpected
T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or
T_NUM_STRING in
/home/apache/172.16.0.1/rdm-business/app/industria/pde/s.-1.rastro.movimenta.spadim
on line 718





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


#42213 [NEW]: Weird integer conversion behaviour

2007-08-05 Thread aries dot belgium at gmail dot com
From: aries dot belgium at gmail dot com
Operating system: Linux
PHP version:  5.2.4RC1
PHP Bug Type: Variables related
Bug description:  Weird integer conversion behaviour

Description:

When placing a zero in front of a number PHP will convert it automatically
to an integer value, but it becomes a zero rather than the number after the
zero.

Reproduce code:
---



Expected result:

int(8) int(8) int(8)

Actual result:
--
int(0) int(8) int(0)

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


#42213 [Opn->Bgs]: Weird integer conversion behaviour

2007-08-05 Thread derick
 ID:   42213
 Updated by:   [EMAIL PROTECTED]
 Reported By:  aries dot belgium at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Variables related
 Operating System: Linux
 PHP Version:  5.2.4RC1
 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

Numbers starting with a 0 are octal numbers and there is no such thing
as "8" there.


Previous Comments:


[2007-08-05 19:51:30] aries dot belgium at gmail dot com

Description:

When placing a zero in front of a number PHP will convert it
automatically to an integer value, but it becomes a zero rather than the
number after the zero.

Reproduce code:
---



Expected result:

int(8) int(8) int(8)

Actual result:
--
int(0) int(8) int(0)





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


#42214 [NEW]: SoapServer sends clients internal PHP errors

2007-08-05 Thread stuart dot caie at gmail dot com
From: stuart dot caie at gmail dot com
Operating system: Ubuntu
PHP version:  5.2.4RC1
PHP Bug Type: SOAP related
Bug description:  SoapServer sends clients internal PHP errors

Description:

When presenting a SOAP API to the general public, I do not want the text
of PHP errors to be send down the wire as "SOAP-ENV;Server" faults. It's
just as embarrassing and as much of a security risk as having the
display_errors INI option turned on - it could reveal exploitable private
implementation details to hostile users.

I would like to catch all PHP errors, log them and instead send the user a
custom SOAP fault which gives them a unique error ID to report (which
matches with my log), but does not reveal the actual PHP error message.

However,

1. use_soap_error_handler() does nothing. Set it to true, it sends out
SOAP-ENV:Server faults with the PHP error message. Set it to false, it
still sends out SOAP-ENV:Server faults with the PHP error message.


2. User-defined error handlers can't catch E_ERROR, E_PARSE, E_CORE_ERROR,
E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT.
Other scripting languages such as Perl (via $SIG{__DIE__}) or Ruby (via
begin/rescue) let user code catch fatal errors, PHP comes up short.

I'd like you to allow PHP to catch fatal errors in the user defined error
handler. If you won't fix that, please add some kind of kludge to
SoapServer so that it doesn't reveal the text of PHP errors to clients.

Reproduce code:
---
fault('error', "report \"$ticket\" to
support");
}
set_error_handler('error_handler');
use_soap_error_handler(false);
$server = new SoapServer(NULL, array('uri' =>
'http://localhost/server.php'));
$server->setClass('test');
$server->handle();
?>


'http://localhost/server.php', 'location' =>
'http://localhost/server.php'));
$client ->test();
?>



Expected result:

client.php: Uncaught SoapFault exception: [error] report "" to
support

server.php: entry in /tmp/soap_error_log reading:
[] 1: Call to undefined function obvious_error() in server.php
line 4


Actual result:
--
client.php: Uncaught SoapFault exception: [SOAP-ENV:Server] Call to
undefined function obvious_error()

server.php: no entry in /tmp/soap_error_log.


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


#42211 [Com]: property_exists() fails to find protected properties from a parent class

2007-08-05 Thread crrodriguez at suse dot de
 ID:   42211
 Comment by:   crrodriguez at suse dot de
 Reported By:  dominics at gmail dot com
 Status:   Open
 Bug Type: Class/Object related
 Operating System: *
 PHP Version:  5.2.4RC1
 New Comment:

If this is not a bug, there is a bug in the documentation ;)

--TEST--
#42211  property_exists( ) fails to find protected properties from a
parent class
--FILE--
foo();

echo "No scope\n";
var_dump(property_exists('B', 'publicBar'));
var_dump(property_exists('B', 'protectedBar'));
var_dump(property_exists('B', 'privateBar'));
?>
--EXPECT--
B
bool(true)
bool(true)
bool(true)
A
bool(true)
bool(true)
bool(false)
No scope
bool(true)
bool(false)
bool(false)

Index: Zend/zend_builtin_functions.c
===
RCS file: /repository/ZendEngine2/zend_builtin_functions.c,v
retrieving revision 1.277.2.12.2.22
diff -u -p -r1.277.2.12.2.22 zend_builtin_functions.c
--- Zend/zend_builtin_functions.c   2 Aug 2007 20:32:44 -  
1.277.2.12.2.22
+++ Zend/zend_builtin_functions.c   5 Aug 2007 23:06:02 -
@@ -974,7 +974,7 @@ ZEND_FUNCTION(property_exists)
if (!(property_info = zend_get_property_info(ce,
*property, 1 TSRMLS_CC)) || property_info == &EG(std_property_info)) {
RETURN_FALSE;
}
-   if (property_info->flags & ZEND_ACC_PUBLIC) {
+   if (property_info->flags & ZEND_ACC_PUBLIC ||
((property_info->flags & ZEND_ACC_PROTECTED) &&
zend_check_protected(property_info->ce, EG(scope {
RETURN_TRUE;
}
zend_unmangle_property_name(property_info->name,
property_info->name_length, &class_name, &prop_name);


ps: will be nice to have a "attachment feature"
Cheers
Cristian (aka judas_isc ;) )


Previous Comments:


[2007-08-05 14:14:36] dominics at gmail dot com

Description:

When using property_exists() from a parent class, and checking for the
existence of a protected property in the subclass, property_exists()
fails to find the property.

The documentation for property_exists() says that the property must be
'accessible from the current scope'. In this case, the property _is_,
because A is a parent class and protected visibility is defined in the
documentation as 'limits access to inherited and parent classes'.

As further evidence that protectedBar is accessible from foo(), trying
to manipulate privateBar causes an error, while manipulating
protectedBar doesn't.

Reproduce code:
---
foo();

Expected result:

bool(true) bool(true) bool(false)

Actual result:
--
bool(true) bool(false) bool(false)





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


#42215 [NEW]: dns_get_record not defined

2007-08-05 Thread developer-support at allknightaccess dot com
From: developer-support at allknightaccess dot com
Operating system: Mac OS 10.4.10, Apache 2.2.4
PHP version:  5.2.4RC1
PHP Bug Type: HTTP related
Bug description:  dns_get_record not defined

Description:

The function dns_get_record is not being defined on Mac OS 10.4.10.

Reproduce code:
---


Expected result:

Array
(
[0] => Array
(
[host] => php.net
[type] => MX
[pri] => 5
[target] => pair2.php.net
[class] => IN
[ttl] => 6765
)

[1] => Array
(
[host] => php.net
[type] => A
[ip] => 64.246.30.37
[class] => IN
[ttl] => 8125
)

)

Actual result:
--
Fatal error: Call to undefined function dns_get_record() 

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


#42217 [NEW]: gzcompress/gzcompress fails with size > 65535 (6mb)

2007-08-05 Thread vodkaproof at gmail dot com
From: vodkaproof at gmail dot com
Operating system: debian
PHP version:  4.4.7
PHP Bug Type: Zlib Related
Bug description:  gzcompress/gzcompress fails with size > 65535 (6mb)

Description:

$big_string = 

$big_string = gzcompress ($big_string, 1);
$big_string = gzuncompress ($big_string);

print $big_string;

The resulting $big_string is cut off after 65535 bytes. 

Bug report was created but ignored.
http://bugs.php.net/bug.php?id=32306


I didn't know of this bug, now I have 200gb of corrupted mysql records. It
will take weeks to recover.


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


#42217 [Opn]: gzcompress/gzcompress fails with size > 65535 (6mb)

2007-08-05 Thread vodkaproof at gmail dot com
 ID:   42217
 User updated by:  vodkaproof at gmail dot com
 Reported By:  vodkaproof at gmail dot com
 Status:   Open
 Bug Type: Zlib Related
 Operating System: debian
 PHP Version:  4.4.7
 New Comment:

Description:

$big_string = 

$big_string = gzcompress ($big_string, 1);
$big_string = gzuncompress ($big_string);

print $big_string;

The resulting $big_string is cut off after 65535 bytes. 

Bug report was created but ignored.
http://bugs.php.net/bug.php?id=32306

I didn't know of this bug, now I have 200gb of corrupted mysql
records.
It will take weeks to recover.

*Edit* - Incase you say increase memory_limit, it's set at 100mb


Previous Comments:


[2007-08-06 06:23:27] vodkaproof at gmail dot com

Description:

$big_string = 

$big_string = gzcompress ($big_string, 1);
$big_string = gzuncompress ($big_string);

print $big_string;

The resulting $big_string is cut off after 65535 bytes. 

Bug report was created but ignored.
http://bugs.php.net/bug.php?id=32306


I didn't know of this bug, now I have 200gb of corrupted mysql records.
It will take weeks to recover.






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


#41615 [Com]: "Out of memory" errors

2007-08-05 Thread rmgraci at yahoo dot com
 ID:   41615
 Comment by:   rmgraci at yahoo dot com
 Reported By:  sms at inbox dot ru
 Status:   No Feedback
 Bug Type: Unknown/Other Function
 Operating System: Windows 2000 SP4
 PHP Version:  5.2.3
 New Comment:

I am also seeing this with php-5.2.3-Win32. I'm using Apache 2.2.4 and
it fails when my script initializes w/ Zend Framework 1.1.0 -

Fatal error: Out of memory (allocated 786432) (tried to allocate 4320
bytes)

The line it fails on changes, but it always fails at 786432. My
memory_limit is set to 128M.


Previous Comments:


[2007-08-02 10:25:56] tyb at egon dot gyaloglo dot hu

I have the same problem.

PHP Fatal error:  Out of memory (allocated 786432) (tried to allocate
393216 bytes)

First time it happens when running a PHPMyAdmin script. After that I
cannot start any php sessions until I restart Apache.

Environment:
Windows Server 2003 SP1
Apache 2.0.58, binary
PHP 5.2.1



[2007-06-21 12:19:55] pepegsay at hotmail dot com

I'm not sure if I'm supposed to add this "how I solved this" note but
here goes:

I solved this error by reducing the Apache ThreadsPerChild. We had
threadsperchild rather high at 250 threads, and if you do the math:
64megs X 250 threads you would require 16 gigs of ram if:

1. Apache never restarted on its own
2. Eventually each thread was used for your largest process

Either way our modest 2 gigs was being eaten up. Whereas PHP used to
either no throw an error or not fault it now says "out of memory".

We have reduced ThreadsPerChild to a level that makes sense when you
multiply memory_limit x ThreadsPerChild, with a touch of overhead since
our processes rarely max out or memory limit, and are no longer seeing
this problem.



[2007-06-19 23:45:13] jetmah at gmail dot com

I have the same error in php-5.2.3-Win32, too.



[2007-06-19 01:50:34] jarit at qq dot com

I have the some proplem too. I set memory_limit to 1024M, but it's no
use.
I use:
php 5.2.3-win32
apache 2.2.0

why does the error "out of memory" happen? thinks.



[2007-06-15 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



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

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


#42195 [Fbk->Opn]: c++ compiler needed ?

2007-08-05 Thread jeremy dot jacque at maximo dot fr
 ID:   42195
 User updated by:  jeremy dot jacque at maximo dot fr
 Reported By:  jeremy dot jacque at maximo dot fr
-Status:   Feedback
+Status:   Open
 Bug Type: *Configuration Issues
 Operating System: AIX 5.1
 PHP Version:  5CVS-2007-08-03 (CVS)
 New Comment:

I' m running configure with "sh" , and the command line is :



./configure --prefix=/patch/php/php-latest \
 --with-apxs2=/patch/php/apache/bin/apxs \
 --without-mysql --enable-calendar --disable-dom --enable-libxml \
 --disable-simplexml --without-libexpat --without-expat --disable-pear
\
 --disable-ipv6 --without-imap --disable-posix \
 --with-jpeg-dir=/opt/freeware --without-sqlite --enable-pcntl \
 --with-png-dir=/opt/freeware --with-xpm-dir=/opt/freeware \
 --with-freetype-dir=/opt/freeware --with-png-dir=/opt/freeware \
 --disable-hash --disable-filter --enable-reflection \
 --with-openssl=/opt/freeware --with-gd --without-iconv \
 --enable-pdo --without-pdo-informix --without-pdo-sqlite \
 --disable-debug --with-regex=system \
 --enable-cli --enable-shared


and my *FLAGS are:

export CC=/usr/vac/bin/cc
export CFLAGS='-q64'
export OBJECT_MODE=64
export LDFLAGS='-L/opt/freeware/lib'
export INFORMIXDIR=/informix2


Previous Comments:


[2007-08-04 00:50:55] [EMAIL PROTECTED]

How exactly did you run configure? Any CFLAGS/LDFLAGS set? What shell?



[2007-08-03 08:56:50] jeremy dot jacque at maximo dot fr

Description:

when running configure and entering the "Configuring libtool" part,
an error occured because i do not have access to an c++ compiler.

By just suppressing the lines referring to c++, it works great,
so the c++ search in configure shouldn't just be optional ??

One more thing, i'm compiling using the native AIX compiler and linker,
and in order to link correctly i use the cheat i saw in bug report
39187
(change 
sed 's/\([A-Za-z0-9_]*\)\.lo/\1.o/g'
   by
sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'
in the BUILD_CLI part of the configure.
When compiling proftpd on the same machine, their configure report
this:
   "checking for objdir... .libs"
Sould it be possible to integrate such a test in your script?
Thank in advance.
Jeremy Jacque

Reproduce code:
---
run configure on a machine with no c++ compiler

Expected result:

Pass the c++ test with no error  (may be a warning ?? )

checking for g++... no
checking for c++... no
checking whether we are using the GNU C++ compiler... no

Actual result:
--
checking for c++... no
checking for g++... no
checking for gcc... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking whether the C++ compiler (gcc   ) works... no
configure: error: installation or configuration problem: C++ compiler
cannot create executables.






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