Skip to content

Commit bf2bb1a

Browse files
author
Edison Calle
committed
Fixing code styling issue. Addressing PR feedback
1 parent 9e46c2f commit bf2bb1a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/org/apache/hadoop/tools/Curl.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ public function __construct($debug = false)
1717
{
1818
$this->debug = $debug;
1919
}
20+
2021
/**
2122
*
2223
* @param $localPath string local file path to save
2324
*/
24-
public function setOption($key,$value) {
25+
public function setOption($key, $value)
26+
{
2527
$this->options[$key] = $value;
2628
}
2729

@@ -213,13 +215,9 @@ private function _exec($options, $returnInfo = false)
213215
if (!$has_content_length_header && !isset($options[CURLOPT_INFILE]) && !isset($options[CURLOPT_INFILESIZE])) {
214216
$length = 0;
215217
if (isset($options[CURLOPT_POSTFIELDS])) {
216-
if (function_exists('mb_strlen')) {
217-
$length = mb_strlen($options[CURLOPT_POSTFIELDS]);
218-
} else {
219-
$length = strlen($options[CURLOPT_POSTFIELDS]);
220-
}
218+
$length = strlen($options[CURLOPT_POSTFIELDS]);
221219
}
222-
$options[CURLOPT_HTTPHEADER] = array_merge($options[CURLOPT_HTTPHEADER], ['Content-Length: '.$length]);
220+
$options[CURLOPT_HTTPHEADER] = array_merge($options[CURLOPT_HTTPHEADER], ['Content-Length: ' . $length]);
223221
}
224222

225223
curl_setopt_array($ch, $options);

0 commit comments

Comments
 (0)