candrasetiadi / php-twitter

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

TwitterAvailable always returns false when using PHP 5.2.0 with json 1.2.1 #50

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. call twitter->twitterAvailable() (json mode)

What is the expected output? What do you see instead?
expected: true
actual: false

What version of the product are you using? On what operating system?
phpTwitter v1.1 OS:Linux 

Please provide any additional information below.
http://www.twitter.com/help/test.json currently contains the literal string
"ok". This is not actually a valid json string (it's not an object or an
array) so the json_decode function returns null (before PHP 5.2.1). The
TwitterAvailable method then returns false because Null does not equal
"ok". My development environment works because I have PHP 5.2.8. The shared
server that hosts the live site uses 5.2.0 which is the stated requirement
for phpTwitter
http://killersoft.com/randomstrings/index.php?tag=json

Original issue reported on code.google.com by David.We...@gmail.com on 2 Oct 2009 at 9:33

GoogleCodeExporter commented 8 years ago
the live environment is more specifically PHP Version 5.2.0-8+etch10. this link
http://killersoft.com/randomstrings/index.php?tag=json explains the json 
validity
concept in more detail.

Original comment by David.We...@gmail.com on 2 Oct 2009 at 9:59