Multiple bugs/Not following twitter oAuth specs #130

slavicd opened this Issue Sep 22, 2011 · 0 comments

1 participant


I found a couple of bugs while using the library:

EpiOAuth.php (::normalizeUrl())
if($port > 0 && ($scheme === 'http' && $port !== 80) || ($scheme === 'https' && $port !== 443))
The second boolean expression (the one compounded with a OR ) should be taken in parenthesis, otherwise it the expression returns TRUE for all https connections, where no specific port was present in the url.

EpiOauth.php: (::prepareParameters())
array_walk($oauth, array($this, 'encode_rfc3986'));
Array walk does not allow to change the values of the array in that way. You need the ::encode_rfc3986() to accept parameters as reference in order to change them.

EpiOauth.php: (::generateSignature())
Concatenation of parameters perform double-encoding which spoils the parameter values.
The line in question: $concatenatedParams = $this->encode_rfc3986(substr($concatenatedParams, 0, -3));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment