Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fix #65483: quoted-printable encode stream filter incorrectly encoding spaces
  Update NEWS
This commit is contained in:
Stanislav Malyshev 2013-08-24 19:48:41 -07:00
commit bdccf0a61d
3 changed files with 24 additions and 1 deletions

2
NEWS
View File

@ -5,6 +5,8 @@ PHP NEWS
- Core:
. Fixed bug #65490 (Duplicate calls to get lineno & filename for
DTRACE_FUNCTION_*). (Chris Jones)
. Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding
spaces). (Michael M Slusarz)
. Fixed bug #65470 (Segmentation fault in zend_error() with
--enable-dtrace). (Chris Jones, Kris Van Hees)
. Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)

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"