Bug #70410 [Asn->Fbk]: Wrong value for 'upload_content_length'
| From: | cmb@php.net | Date: | Sun, 10 Jul 2016 14:45:07 +0000 |
| Subject: | Bug #70410 [Asn->Fbk]: Wrong value for 'upload_content_length' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202174@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70410&edit=1
ID: 70410
Updated by: cmb@php.net
Reported by: marco dot marsala at live dot it
Summary: Wrong value for 'upload_content_length'
-Status: Assigned
+Status: Feedback
Type: Bug
Package: HTTP related
Operating System: CentOS 6
PHP Version: 5.4.44
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The documentation of CURLINFO_CONTENT_LENGTH_UPLOAD[1] notes:
| Since 7.19.4, this returns -1 if the size isn't known.
As you're using newer versions in all cases, this does not matter.
To properly diagnose the problem, we need a short but complete
example script to be able to reproduce this bug ourselves.
A proper reproducing script starts with <?php, is max. 10-20 lines
long and does not require any external resources such as
databases, etc. If the script requires a database to demonstrate
the issue, please make sure it creates all necessary tables,
stored procedures etc.
Please avoid embedding huge scripts into the report.
[1] <https://curl.haxx.se/libcurl/c/CURLINFO_CONTENT_LENGTH_UPLOAD.html>
Previous Comments:
------------------------------------------------------------------------
[2015-09-02 22:34:38] marco dot marsala at live dot it
On PHP 5.3 I have:
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
On PHP 5.4.44 and PHP 5.5 I have newer versions of curl.
The issue seems to happen with newer versions
------------------------------------------------------------------------
[2015-09-02 15:04:04] cmb@php.net
The different behavior may be caused by different libcurl versions
(and not directly be related to PHP). Which libcurl version(s) do
you use (see e.g. PHP info)?
------------------------------------------------------------------------
[2015-09-02 13:24:26] marco dot marsala at live dot it
Description:
------------
In PHP 5.4.44 curl_getinfo($ch) for a POST request, returns an array where
'upload_content_length' is equal to the length of the post fields string.
In PHP 5.3 'upload_content_length' is float(0) but 'size_upload' assumes that
value.
Seems that the behavior of PHP 5.3 is correct and PHP 5.4 is wrong (but maybe the opposite).
This should be fixed or pointed out in the documentation as this glitch broken my script while
downgrading php.
---
From manual page: http://www.php.net/function.curl-getinfo
---
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70410&edit=1