php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46739 array returned by curl_getinfo should contain content_type key
Submitted: 2008-12-03 14:53 UTC Modified: 2008-12-04 13:15 UTC
From: thomas at koch dot ro Assigned:
Status: Closed Package: cURL related
PHP Version: 5.3CVS-2008-12-03 (CVS) OS: Debian Lenny
Private report: No CVE-ID: None
 [2008-12-03 14:53 UTC] thomas at koch dot ro
Description:
------------
The docu[1] states, that the array returned by curl_getinfo contains a key 'content_type'.
But this is not the case, if there has been a connection error.

[1] http://www.php.net/manual/en/function.curl-getinfo.php

Reproduce code:
---------------
$ch = curl_init('xyz');

curl_exec( $ch );
$curlInfo = curl_getinfo( $ch );
var_dump( $curlInfo['content_type'] );


Expected result:
----------------
NULL

Actual result:
--------------
Notice: Undefined index: content_type in /home/ymc-toko/curl_bug.php on line 7
NULL

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-04 13:15 UTC] mkoppanen@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2009-07-26 02:12 UTC] svn@php.net
Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=286340
Log: The test for bug #46739 doesn't actually need the remote
responder, so get rid of the skipif in PHP 5, and it was
broken in PHP 6 because the keys in the curl_info array
were not unicode.  All internally-generated arrays should
have unicode keys.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC