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
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:
MUST BE VALID
Solve the problem:
31 - 14 = ?
Subscribe to this entry?

 
 [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: Wed May 01 16:01:31 2024 UTC