Skip to content

Commit

Permalink
Merge pull request #142 from J7mbo/develop
Browse files Browse the repository at this point in the history
Boolean Fix
  • Loading branch information
J7mbo committed Aug 3, 2015
2 parents 7e7aefc + 928f5ad commit a89ce3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion TwitterAPIExchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ public function setPostfields(array $array)
{
$array['status'] = sprintf("\0%s", $array['status']);
}

foreach ($array as $key => &$value)
{
if (is_bool($value))
{
$value = ($value === true) ? 'true' : 'false';
}
}

$this->postfields = $array;

Expand Down Expand Up @@ -315,7 +323,7 @@ private function buildBaseString($baseURI, $method, $params)
{
$return = array();
ksort($params);

foreach($params as $key => $value)
{
$return[] = rawurlencode($key) . '=' . rawurlencode($value);
Expand Down
1 change: 1 addition & 0 deletions test/TwitterAPIExchangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ public function testStatusesUpdate()
$method = 'POST';
$params = array(
'status' => 'TEST TWEET TO BE DELETED' . rand(),
'possibly_sensitive' => false,
'media_ids' => self::$mediaId
);

Expand Down

0 comments on commit a89ce3e

Please sign in to comment.