urandu / oauth-php

Automatically exported from code.google.com/p/oauth-php
MIT License
0 stars 0 forks source link

Array of Array #131

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Function getNormalizedParams() in OAuthRequest.php not support Array of Array 
variable.

if i have variable like bellow

$body = array(
    "content" => "test content",
    "is_sanitize" => true,
    "sanitize_replacement" => "***",
    "meta" => array(
        "name" => "another",
        "email" => "another@email.com"
        )
    );

when using getNormalizedParams() will return

content=test 
content&is_sanitize=1&meta=another&meta=another@email.com&sanitize_replacement=*
**

i lose my key(name and email), but when i use http_build_query, it return

content=content+test&is_sanitize=1&sanitize_replacement=%2A%2A%2A&meta%5Bname%5D
=another&meta%5Bemail%5D=another%40email.com

what i want to mention is when i have Array of Array and using this library, i 
will lose any Array inside variable when generating a base query to make a 
signature, and this will cause a possible collation.

From the spec http://tools.ietf.org/html/rfc3986 say that all variable must be 
added to make a signature.

actually i'm newbie, so may be i already understand wrong with this issue.

Thanks

Original issue reported on code.google.com by ahmadfat...@gmail.com on 17 Dec 2012 at 4:24