From 21ca70f42bf7c3c8ae5b3b2c11444cc8ca6d3fbe Mon Sep 17 00:00:00 2001 From: pp11 Date: Sat, 7 Feb 2009 12:11:53 +0000 Subject: [PATCH] Fix for bug report [ 2151981 ] SimpleMultipartEncoding#writeHeadersTo() has wrong delimiter --- encoding.php | 2 +- test/encoding_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/encoding.php b/encoding.php index 05895aef..eb723a49 100644 --- a/encoding.php +++ b/encoding.php @@ -521,7 +521,7 @@ function __construct($query = false, $boundary = false) { */ function writeHeadersTo(&$socket) { $socket->write("Content-Length: " . (integer)strlen($this->encode()) . "\r\n"); - $socket->write("Content-Type: multipart/form-data, boundary=" . $this->boundary . "\r\n"); + $socket->write("Content-Type: multipart/form-data; boundary=" . $this->boundary . "\r\n"); } /** diff --git a/test/encoding_test.php b/test/encoding_test.php index 4003edda..9c52042a 100644 --- a/test/encoding_test.php +++ b/test/encoding_test.php @@ -205,7 +205,7 @@ function testEmptyEncodingWritesZeroContentLength() { function testEmptyMultipartEncodingWritesEndBoundaryContentLength() { $socket = new MockSimpleSocket(); $socket->expectAt(0, 'write', array("Content-Length: 14\r\n")); - $socket->expectAt(1, 'write', array("Content-Type: multipart/form-data, boundary=boundary\r\n")); + $socket->expectAt(1, 'write', array("Content-Type: multipart/form-data; boundary=boundary\r\n")); $encoding = new SimpleMultipartEncoding(array(), 'boundary'); $encoding->writeHeadersTo($socket); }