Merge branch 'pull-request/414'

* pull-request/414:
  Fix #65483: quoted-printable encode stream filter incorrectly encoding spaces
This commit is contained in:
Stanislav Malyshev 2013-08-24 19:49:59 -07:00
commit 8ee126f0bb
2 changed files with 22 additions and 1 deletions

View File

@ -951,7 +951,9 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins
*(pd++) = qp_digits[(c & 0x0f)];
ocnt -= 3;
line_ccnt -= 3;
trail_ws--;
if (trail_ws > 0) {
trail_ws--;
}
CONSUME_CHAR(ps, icnt, lb_ptr, lb_cnt);
}
}

View File

@ -0,0 +1,19 @@
--TEST--
Bug #65483: quoted-printable encode stream filter incorrectly encoding spaces
--FILE--
<?php
$data = 'a b=c d';
$fd = fopen('php://temp', 'w+');
fwrite($fd, $data);
rewind($fd);
$res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ);
var_dump(stream_get_contents($fd, -1, 0));
fclose($fd);
?>
--EXPECT--
string(9) "a b=3Dc d"