php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70217 cURL Malformed URL Exception with OAuth
Submitted: 2015-08-08 23:13 UTC Modified: 2015-08-30 04:22 UTC
From: twOauth at mailinator dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.5.28 OS: OSX 10.10.5
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-08-08 23:13 UTC] twOauth at mailinator dot com
Description:
------------
On OSX 10.10.5, I created a clean install of Twitter OAuth using composer

https://github.com/abraham/twitteroauth

and ran the test script below with a valid CONSUMER_KEY, CONSUMER_SECRET (validated using the Twitter OAuth tool that returns the expected result).

 php -S localhost:1234

PHP version is PHP 5.5.27 (cli) (built: Jul 23 2015 00:21:59)


Test script:
---------------
<?php 

    require "vendor/autoload.php";
    use Abraham\TwitterOAuth\TwitterOAuth;

    define('CONSUMER_KEY', '...');
    define('CONSUMER_SECRET', '..');
    define('OAUTH_CALLBACK', 'test2.php');

    $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
    $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));

?>


Expected result:
----------------
The script should above should return an oauth token.

Actual result:
--------------
/test.php - Uncaught exception 'Abraham\TwitterOAuth\TwitterOAuthException' in      /Users/username/Dev/twitter/vendor/abraham/twitteroauth/src/TwitterOAuth.php:141
Stack trace:
#0 /Users/username/Dev/twitter/test.php(12): Abraham\TwitterOAuth\TwitterOAuth->oauth('oauth/request_t...', Array)
#1 {main}
thrown in /Users/username/Dev/twitter/vendor/abraham/twitteroauth/src/TwitterOAuth.php on line 141


$curlErrno = curl_errno($curlHandle);

var_dump($curlErrno);

results in int(3), which from http://php.net/manual/en/function.curl-errno.php is [3] => 'CURLE_URL_MALFORMAT'.

Note this issue does not occur on PHP 5.6.11 (cli) (built: Jul 10 2015 22:36:04).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-18 19:53 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2015-08-18 19:53 UTC] cmb@php.net
Thank you for this bug report. 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 and ends with ?>,
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.


 [2015-08-30 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: Sun Apr 28 19:01:28 2024 UTC