[PHP-BUG] Bug #62524 [NEW]: fopen follows redirects for non-3xx statuses

2012-07-10 Thread mike dot hall at twistdigital dot co dot uk
From: mike dot hall at twistdigital dot co dot uk
Operating system: Ubuntu 12.04
PHP version:  5.4.4
Package:  Streams related
Bug Type: Bug
Bug description:fopen follows redirects for non-3xx statuses

Description:

The HTTP location header can either be used to direct the user to another 
resource (when accompanied by a 3xx status code) or to inform the user of
the 
location of the document they just created (with a 2xx) status code.

It doesn't make sense to treat the location header as a redirect in the
second 
context - the location header indicates a redirect only when accompanied by
a 3xx 
status code.

Currently, PHP follows Location headers as if they are redirects regardless
of 
the returned status code.

Test script:
---
$context = stream_context_create([
"http" => [
"method"  => "POST"
"header"  => "Content-Length: 13"
"content" => "{\"foo\":\"bar\"}",
],
]);

// Returns HTTP/1.1 201 Created
// Location: http://example.com/mydb/documentid
//
// {"status":"ok"}
$fp = fopen('http://example.com/mydb', 'r', null, $context);
$data = stream_get_contents($fp);

list($headers, $body) = explode("\r\n\r\n", $data, 2);
echo $body;

Expected result:

{"status":"ok"}

Actual result:
--
{"foo":"bar"}

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



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

2010-01-11 Thread mike dot hall at twistdigital dot co dot uk
 ID:   48216
 Comment by:   mike dot hall at twistdigital dot co dot uk
 Reported By:  mark at everytruckjob dot com
 Status:   No Feedback
 Bug Type: SOAP related
 Operating System: CentOs 5.3
 PHP Version:  5.3.0RC2
 New Comment:

I'm having the same issue, also using chunked-encoding.

Date: Mon, 11 Jan 2010 15:44:23 GMT

Last-Modified: Fri, 09 Oct 2009 13:49:56 GMT

Accept-Ranges: bytes

Content-Type: text/xml

Cache-Control: private

Content-Encoding: gzip

Transfer-Encoding: chunked


Previous Comments:


[2010-01-08 20:02:28] mike at pixor dot net

I downloaded the 1/6/10 5.3.3-dev snapshot and was still having issues

with SOAP WSDL file parsing.  5.2.12 works fine.  Please keep this
issue 
open.



[2009-12-21 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".



[2009-12-13 19:05:05] fel...@php.net

Please try using this snapshot:

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

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





[2009-12-02 16:29:03] php dot net at drsdre dot org

Had the same issue with PHP 5.3.0. Content-lenght was available in the
header, but PHP gace fatel error 'extra content at the end of the
document'.

With php-5.3-win32-VC6-x85-latest.zip the WSDL is being read without
problems.



[2009-11-23 19:04:52] ondra dot podolinsky at seznam dot cz

The same problem: win xp, php 5.3.0.
[faultstring] => SOAP-ERROR: Parsing WSDL: Couldn't load from
'http://webapi.allegro.pl/uploader.php?wsdl' : Extra content at the end
of the document [faultcode] => WSDL



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

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



#33711 [NEW]: unset() doesn't destroy object with internal references

2005-07-15 Thread mike dot hall at twistdigital dot co dot uk
From: mike dot hall at twistdigital dot co dot uk
Operating system: FreeBSD
PHP version:  5.1.0b2
PHP Bug Type: Class/Object related
Bug description:  unset() doesn't destroy object with internal references

Description:

PHP doesn't unset an object if it contains variables that include
references to itself. Despite being unset, the objects remain in memory
until the end of the request. This can lead to scripts consuming large
amounts of memory when larger and more complex objects are being employed.

Reproduce code:
---
http://www.indelible.org.uk/reproduce.php

Expected result:

0
Create A
Create B
Destroying B
Destroying A
1
Create A
Create B
Destroying B
Destroying A
2
Create A
Create B
Destroying B
Destroying A
End of Loop

Actual result:
--
0
Create A
Create B
1
Create A
Create B
2
Create A
Create B
End of Loop
Destroying A
Destroying B
Destroying A
Destroying B
Destroying A
Destroying B

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