php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59725 OAuthProvider not accepting multi-dimensional query params
Submitted: 2011-04-20 11:31 UTC Modified: 2011-05-14 01:28 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: archuleta at seqcentral dot com Assigned:
Status: Open Package: oauth (PECL)
PHP Version: 5.3.5 OS: Mac OS 10.5.8
Private report: No CVE-ID: None
 [2011-04-20 11:31 UTC] archuleta at seqcentral dot com
Description:
------------
Sending a query parameter such as, "oauth?a[b][c]=d", to the 
OAuthProvider::checkOAuthRequest results in an "Array to 
String" exception.

The cause for this appears to be that OAuth first converts the 
query param into a multi-dimensional array, and then creates 
the signature. (

Instead of trying to convert to an object/array first, I think 
OAuthProvider should treat the params as a 1-D key-value array 
where some of the keys happen to have '[' and ']'.

Reproduce code:
---------------
$consumer->fetch("http://localhost/oauth?a[b][c]=d");
// Note that the below fails on fetch even though it's the "same" as the above (Bug 17572)
// $consumer->fetch("http://localhost/oauth", array('a' => array('b' => array('c' => 'd'))));


$provider = new OAuthProvider();
$provider->is2LeggedEndpoint(true);
$provider->consumerHandler('lookupConsumer');
$provider->timestampNonceHandler('timestampNonceHandler');
$provider->checkOAuthRequest();




Actual result:
--------------
ErrorException [ Notice ]: Array to string conversion


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-13 20:16 UTC] datibbaw@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PECL.

This question has been addressed in #17572
 [2011-05-14 01:28 UTC] datibbaw@php.net
Sorry, didn't read the bug properly ;)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 23:01:29 2024 UTC