FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=15358&edit=1

ID: 15358
Updated by: cweiske@php.net
Reported By: davidc at agoraproduction dot com
Summary: verify_credentials wrong type checking
-Status: Assigned
+Status: Open
Type: Bug
Package: Services_Twitter
Operating System: Irrelevant
Package Version: CVS
PHP Version: 5.2.6
Assigned To: izi
Roadmap Versions:
New Comment:

-Status: Assigned
+Status: Open



Previous Comments:
------------------------------------------------------------------------

[2009-06-07 13:48:55] nicolagreco

i fixed it with this:

try {
$twitter = new Services_Twitter( $user_login, $password );
$res = $twitter->account->verify_credentials();
} catch (Services_Twitter_Exception $e) {
$res = true;
}
if ( $res ) $loggin = false;
else $loggin = true;

given that if the user and pass doesn't match it die() with an error,
so if there is an error, the loggin is false, if there is no error it
return false, so the login is true

------------------------------------------------------------------------

[2008-12-19 14:33:53] davidc

Description:
------------
What steps will reproduce the problem?
1. New twitter object
2. invoke var_dump($twit->account->verify_credentials())


What is the expected output? What do you see instead?
Exp: bool(true)
Get: bool(false)

What version of the product are you using? On what operating system?
pear install Services_Twitter-beta (latest)

Please provide any additional information below.
in Services/Twitter/Account.php instead of doing return ((string)$res
===
true) simply do return (is_object($string) === true); Since what is
returned is a SimpleXMLElement Object.



Test script:
---------------
<?php

$t = new Services_Twitter('good', 'pass');
var_dump($t->account->verify_credentials());

Expected result:
----------------
bool (true)

Actual result:
--------------
bool (false)

------------------------------------------------------------------------

Search Discussions

  • Izi at Aug 26, 2009 at 12:35 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=15358&edit=1

    ID: 15358
    Updated by: izi@php.net
    Reported By: davidc at agoraproduction dot com
    Summary: verify_credentials wrong type checking
    -Status: Open
    +Status: Closed
    Type: Bug
    Package: Services_Twitter
    Operating System: Irrelevant
    Package Version: CVS
    PHP Version: 5.2.6
    -Assigned To:
    +Assigned To: izi
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: izi
    This bug has been fixed in CVS.

    If this was a documentation problem, the fix will appear on
    pear.php.net by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

    account/verify_credentials now return a stdclass instance representing
    the user, see:
    http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-account%C2%A0verify_credentials


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-08-18 09:43:39] cweiske

    -Status: Assigned
    +Status: Open


    ------------------------------------------------------------------------

    [2009-06-07 13:48:55] nicolagreco

    i fixed it with this:

    try {
    $twitter = new Services_Twitter( $user_login, $password );
    $res = $twitter->account->verify_credentials();
    } catch (Services_Twitter_Exception $e) {
    $res = true;
    }
    if ( $res ) $loggin = false;
    else $loggin = true;

    given that if the user and pass doesn't match it die() with an error,
    so if there is an error, the loggin is false, if there is no error it
    return false, so the login is true

    ------------------------------------------------------------------------

    [2008-12-19 14:33:53] davidc

    Description:
    ------------
    What steps will reproduce the problem?
    1. New twitter object
    2. invoke var_dump($twit->account->verify_credentials())


    What is the expected output? What do you see instead?
    Exp: bool(true)
    Get: bool(false)

    What version of the product are you using? On what operating system?
    pear install Services_Twitter-beta (latest)

    Please provide any additional information below.
    in Services/Twitter/Account.php instead of doing return ((string)$res
    ===
    true) simply do return (is_object($string) === true); Since what is
    returned is a SimpleXMLElement Object.



    Test script:
    ---------------
    <?php

    $t = new Services_Twitter('good', 'pass');
    var_dump($t->account->verify_credentials());

    Expected result:
    ----------------
    bool (true)

    Actual result:
    --------------
    bool (false)

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 18, '09 at 7:43a
activeAug 26, '09 at 12:35p
posts2
users2
websitepear.php.net

2 users in discussion

Cweiske: 1 post Izi: 1 post

People

Translate

site design / logo © 2022 Grokbase