Description
Steps to reproduce
compile with 2.4.0rc2 and try to use a %systemvariable% in the web form, e.g. the display
Does the problem presist after powering off and on? (just resetting isnt enough sometimes)
yes
Expected behavior
It should work like in 2.3.0
Actual behavior
the string that I enter in the form gets truncated after the %. Whats more, it is likely to crash the ESP.
The behaviour is related to the url percent encoding.
If I want a line
bla.exe?x=1+dom.GetObject("%valname%").State(%value%)
in the form, I need to enter
bla.exe%3Fx%3D1%2Bdom.GetObject%28%22%25valname%25%22%29.State%28%25value%25%29
for it to work.
Solution:
I have done some digging. It seems that 2.4.0rc2 has fixed a bug (or at least they made a change) that automaticly percent decodes strings received from html form method='post'
forms. If the form is a <form method='post' enctype='multipart/form-data'>
it all works fine. The string is then not encoded by the browser and not decoded by the ESP. I tried it and it works for me (firefox on win7 and chrome on android). As I am not an expert for web coding it would be nice to get some confirmation.
What remains a mystery is why the ESP crashes with %systemvariables% the <form method='post' >
forms. If the ESPEasy does not work with malformed form strings this should be fixed.
System configuration
Hardware:
wemos d1 mini
Software or git version:
2.4.0rc2 core and 2.0.0r12