Skip to content

Commit

Permalink
Merge pull request #119 from danrot/mime_parts_empty_arrays
Browse files Browse the repository at this point in the history
fixed mime part generation for empty arrays
  • Loading branch information
dbu committed Aug 15, 2015
2 parents 3d3ba7c + 93841c9 commit ed165c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Jackalope/Transport/Jackrabbit/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,6 @@ protected function getMimePart($name, $value, $mime_boundary)
$data = '';

$eol = "\r\n";
$data .= '--' . $mime_boundary . $eol ;
if (is_array($value)) {
if (is_array($value[0])) {
foreach ($value[0] as $v) {
Expand All @@ -2097,6 +2096,7 @@ protected function getMimePart($name, $value, $mime_boundary)

return $data;
}
$data .= '--' . $mime_boundary . $eol ;

if (is_resource(($value[0]))) {
$data .= 'Content-Disposition: form-data; name="' . $name . '"; filename="' . $name . '"' . $eol;
Expand Down Expand Up @@ -2125,6 +2125,7 @@ protected function getMimePart($name, $value, $mime_boundary)

return $data;
}
$data .= '--' . $mime_boundary . $eol ;
$data .= 'Content-Disposition: form-data; name="'.$name.'"'. $eol;
$data .= 'Content-Type: text/plain; charset=UTF-8'. $eol;
$data .= 'Content-Transfer-Encoding: 8bit'. $eol. $eol;
Expand Down

0 comments on commit ed165c9

Please sign in to comment.