From 24d435bfa302b0008f9668902eaf08f09bdfdc26 Mon Sep 17 00:00:00 2001 From: Matt Rose Date: Fri, 23 May 2014 00:20:15 -0700 Subject: [PATCH] fixed bug where nonce was sometimes 1 character below min --- php/OAuthSimple.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/OAuthSimple.php b/php/OAuthSimple.php index 5212805..3c7749b 100644 --- a/php/OAuthSimple.php +++ b/php/OAuthSimple.php @@ -392,7 +392,7 @@ class OAuthSimple { $cLength = strlen($this->_nonce_chars); for ($i=0; $i < $length; $i++) { - $rnum = rand(0,$cLength); + $rnum = rand(0,$cLength - 1); $result .= substr($this->_nonce_chars,$rnum,1); } $this->_parameters['oauth_nonce'] = $result;