Login   Register  
PHP Classes
elePHPant
Icontem

small fix for usernames with underscores

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Twitter  >  All threads  >  small fix for usernames with underscores  >  (Un) Subscribe thread alerts  
Subject:small fix for usernames with underscores
Summary:Here is a small fix for the twitter.class.php
Messages:2
Author:crappy pooo bottoms
Date:2009-05-06 16:41:13
Update:2009-05-07 15:47:06
 

  1. small fix for usernames with underscores   Reply  
Picture of crappy pooo bottoms
crappy pooo bottoms
2009-05-06 16:41:13
On line 16 of the twitter.class.php you have:

$this->auth = base64_encode($user . ':' . $pass);

Replace it with:

$this->auth = strtr(base64_encode($user . ':' . $pass) , '+/=' , '-_,');

Now twitter accounts with an "_" in the unsername will work!

Yea!

  2. Re: small fix for usernames with underscores   Reply  
Picture of crappy pooo bottoms
crappy pooo bottoms
2009-05-07 15:47:06 - In reply to message 1 from crappy pooo bottoms
^^^ Actually that wont work.

Replace Original:
$this->auth = base64_encode($user . ':' . $pass);

With this:

$this->auth = base64_encode(strtr($user , '+/=' , '-_,') . ':' . $pass);