|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58921 Character encoding causing auth problems
Submitted: 2009-10-26 15:33 UTC Modified: 2010-05-03 09:49 UTC
From: jrossiter at dlvr dot it Assigned: datibbaw (profile)
Status: No Feedback Package: oauth (PECL)
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jrossiter at dlvr dot it
New email:
PHP Version: OS:


 [2009-10-26 15:33 UTC] jrossiter at dlvr dot it
The issue described in this Twitter-API bug ( still seems to be affecting this library.

Posting to Twitter with a message containing "?" is failing with Bad Auth.

Reproduce code:
$msg = "Blah Blah ?";
$oauth = new OAuth(self::$oauth_key, self::$oauth_sec, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
$oauth->fetch("", array('status' => $msg),  OAUTH_HTTP_METHOD_POST);

Expected result:
Request is made with correct signature/data.

Actual result:
Request fails due to apparent signature/data mismatch.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-26 17:38 UTC] jrossiter at dlvr dot it
Note, specifically this fails with chr(0xe9).  Frequently during file editing this is converted to chr(0xc3).chr(0xa9) which works fine.

A revision to the reproduction code... it only fails if there are characters *after* the 0xe9 char.
 [2009-10-31 15:07 UTC]
Thanks for the bug report, I will investigate further.
 [2009-11-06 09:22 UTC]

What version of OAuth are you using?

Please run the following:
$ php --ri oauth
 [2009-11-06 14:47 UTC] jrossiter at dlvr dot it
I swear that I had to input that when entering the bug - don't know why it isn't recorded.


OAuth support => enabled
PLAINTEXT support => not supported
RSA-SHA1 support => not supported
HMAC-SHA1 support => enabled
source version => $Id: oauth.c,v 1.56 2009/05/10 06:40:59 jawed Exp $
version => 0.99.9
 [2009-11-06 19:32 UTC]
I couldn't reproduce this on my own branch; feel free to give it a spin, it's in the OAUTH_1A_STREAMS branch which has some added features such as support for PHP streams and forward compatibility for Unicode support.

I'll try the trunk version as well to see what has changed in the meantime
 [2009-12-04 19:06 UTC] jrossiter at dlvr dot it
I encountered another issue along the same lines and finally had a chance to try out the OAUTH_1A_STREAMS branch.

It did seem to resolve the problem, but we'll be testing it further.  I haven't tried it with this bug's specific test case yet.
 [2010-05-03 09:49 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Feb 28 03:01:27 2020 UTC