peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.33k stars 202 forks source link

rawurlencode() should encode according to RFC 3986 #998

Closed jakubmisek closed 2 years ago

jakubmisek commented 2 years ago

Since rawurlencode() in PeachPie uses Uri.EscapeUriString(), the result actually complies with RFC 2396;

It needs to be RFC 3986 always (not depending on web.config or other configuration).

Test:

<?php
print_r(rawurlencode('/+='));

Expected: %2F%2B%3D Actual: /+=


The resulting value is usually used on raw HTTP streams (such as POST) resulting in failed requests.