ID:2359097
 
Resolved
url_encode() was not properly removing internal macros like \a.
BYOND Version:512
Operating System:Windows 10 Pro 64-bit
Web Browser:Firefox 58.0
Applies to:Dream Daemon
Status: Resolved (512.1420)

This issue has been resolved.
Descriptive Problem Summary:
When url_encoding a string containing a macro, the macro's internal representation is included in the encoding result. This leads to a "malformed URI sequence" error when decoding the text using javascript on the client side.

Numbered Steps to Reproduce Problem:
1. try to url_encode a string containing a text macro
2. result string contains "garbage" characters dependent on the macro used.

Code Snippet (if applicable) to Reproduce Problem:
url_encode("\a Test")


Expected Results:
Test

Actual Results:
%ff%06Test

Does the problem occur:
Seemingly occurs for most macros (\a, \the etc.), with a different byte following FF. 08 for \the etc.

When does the problem NOT occur?
[num]\th at least seems unaffected.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
Have not tested 511, I assume the problem is present there as well.

Workarounds:
-

Lummox JR resolved issue with message:
url_encode() was not properly removing internal macros like \a.