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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sun Dec 22 06:01:30 2024 UTC