Using empty() on a string 0 returns true. Using strlen instead.

php -r '$string="0"; var_dump(empty($string));'
    bool(true)
This commit is contained in:
Jaisen Mathai
2011-10-20 17:14:08 -07:00
parent 9cde1ce559
commit 1ff9b5ecda
+1 -1
View File
@@ -326,7 +326,7 @@ class OAuthSimple {
function _oauthEscape($string) {
if ($string === 0)
return 0;
if (empty($string))
if (strlen($string) == 0)
return '';
if (is_array($string))
throw new OAuthSimpleException('Array passed to _oauthEscape');