Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix #65483: quoted-printable encode stream filter incorrectly encoding s... #414

Merged
merged 1 commit into from

2 participants

@slusarz

...paces

@php-pulls php-pulls merged commit 5201a2d into php:master

1 check failed

Details default The Travis CI build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
4 ext/standard/filters.c
@@ -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
19 ext/standard/tests/streams/bug65483.phpt
@@ -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"
Something went wrong with that request. Please try again.