File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/org/apache/hadoop/tools Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments