php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70410 Wrong value for 'upload_content_length'
Submitted: 2015-09-02 13:24 UTC Modified: 2016-07-24 04:22 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: marco dot marsala at live dot it Assigned: cmb (profile)
Status: No Feedback Package: HTTP related
PHP Version: 5.4.44 OS: CentOS 6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-09-02 13:24 UTC] 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
---



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-02 15:04 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2015-09-02 15:04 UTC] 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 22:34 UTC] marco dot marsala at live dot it
-Status: Feedback +Status: Assigned
 [2015-09-02 22:34 UTC] 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
 [2016-07-10 14:45 UTC] cmb@php.net
-Status: Assigned +Status: Feedback
 [2016-07-10 14:45 UTC] cmb@php.net
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>
 [2016-07-24 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 20:01:34 2024 UTC