|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24748 URL in curl_ini() echos out data
Submitted: 2003-07-22 01:43 UTC Modified: 2003-07-22 01:54 UTC
From: Assigned:
Status: Not a bug Package: cURL related
PHP Version: 4.3.3RC1 OS: Linux, RH8.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
31 - 5 = ?
Subscribe to this entry?

 [2003-07-22 01:43 UTC]
$ch = curl_ini("");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$page = curl_exec($ch);

Will echo the page out to the browser even though you specified not to do so with the non-zero RETURNTRANSFER value.

If you instead do:

$ch = curl_ini();
curl_setopt($ch, CURLOPT_URL, "");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$page = curl_exec($ch);

The problem goes away.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-22 01:54 UTC]
Oops, bug in my code. Sorry.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 21:03:39 2021 UTC