Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit a89ce3e

Browse files
committed
Merge pull request #142 from J7mbo/develop
Boolean Fix
2 parents 7e7aefc + 928f5ad commit a89ce3e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

TwitterAPIExchange.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ public function setPostfields(array $array)
110110
{
111111
$array['status'] = sprintf("\0%s", $array['status']);
112112
}
113+
114+
foreach ($array as $key => &$value)
115+
{
116+
if (is_bool($value))
117+
{
118+
$value = ($value === true) ? 'true' : 'false';
119+
}
120+
}
113121

114122
$this->postfields = $array;
115123

@@ -315,7 +323,7 @@ private function buildBaseString($baseURI, $method, $params)
315323
{
316324
$return = array();
317325
ksort($params);
318-
326+
319327
foreach($params as $key => $value)
320328
{
321329
$return[] = rawurlencode($key) . '=' . rawurlencode($value);

test/TwitterAPIExchangeTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ public function testStatusesUpdate()
209209
$method = 'POST';
210210
$params = array(
211211
'status' => 'TEST TWEET TO BE DELETED' . rand(),
212+
'possibly_sensitive' => false,
212213
'media_ids' => self::$mediaId
213214
);
214215

0 commit comments

Comments
 (0)