php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59700 No path on URL causes fatal exception
Submitted: 2011-04-04 15:31 UTC Modified: 2011-06-27 19:56 UTC
From: php at magicmonkey dot org Assigned:
Status: Closed Package: oauth (PECL)
PHP Version: 5.3.1 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at magicmonkey dot org
New email:
PHP Version: OS:

 

 [2011-04-04 15:31 UTC] php at magicmonkey dot org
Description:
------------
Line 687 of oauth.c has an "if" on the "urlparts" variable, 
but if that "if" is false then the result is not gracefully 
handled.  Specifically, making a request to 
"http://server.local" causes an error "Invalid protected 
resource url, unable to generate signature base string" but 
it would be more useful to say that the path part of the URL 
is missing (ie "http://server.local/" with the trailing slash 
works).

Reproduce code:
---------------
$oauth = new OAuth($config['consumer_key'], $config['consumer_secret']);
$oauth->setToken($oauth_token, $oauth_token_secret);
$result = $oauth->fetch("http://server.local", null, OAUTH_HTTP_METHOD_GET);


Expected result:
----------------
An error about the missing path on the URL (or even for it to 
add the / to the end of the URL like what curl does)

Actual result:
--------------
Invalid protected resource url, unable to generate signature 
base string

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-28 12:49 UTC] jawed@php.net
Thx, a more useful exception should be thrown in trunk :-)

- JJ
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 12:01:28 2024 UTC