From 1ff9b5ecda2e81cc6e8a8cdef6dc5377bba01b83 Mon Sep 17 00:00:00 2001 From: Jaisen Mathai Date: Thu, 20 Oct 2011 17:14:08 -0700 Subject: [PATCH] Using empty() on a string `0` returns true. Using strlen instead. php -r '$string="0"; var_dump(empty($string));' bool(true) --- php/OAuthSimple.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/OAuthSimple.php b/php/OAuthSimple.php index 7e1a136..0a20c07 100644 --- a/php/OAuthSimple.php +++ b/php/OAuthSimple.php @@ -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');