Closed 28Smiles closed 3 months ago
If you tell me which version you prefer, I would try to file a patch
Hi @28Smiles ,
Sorry, for not responding sooner. I was off sick.
I did take a look at your issue and was able to understand and reproduce it. The bug is a matter of code execution order. The {coursename} tag needs to be processed before the {urlencode} tags. It is a matter of shifting code around. Last year I though I worked through this for most tags but I guess this one escaped me.
You are welcome to submit a PR. However, I am not clear about your question regarding "which version I prefer". Can you clarify?
Best regards,
Michael
The php function urlencode
is not the one adhering to RFC 8936, therefore it would be nice to use rawurlencode
either by changing the implementation or creation of a new tag for this version.
Thank you Leon for fixing this issue.
Prerequisites
What happened?
Using tags within
urlencode
orqrcode
are not replaced with their content and whitespace is encoded with+
instead of%2B
(Unlike specified in RFC 3986). Example:{urlencode}Test {coursename}{/urlencode}
Result:Test+%7Bcoursename%7D
For a RFC 3986 compliant encoding use
rawurlencode
, either we change this or provide an additional tag.What do you think should have happened?
I expected
Test%2BThis%2Bis%2Ba%2Bcourse
Steps to reproduce
{urlencode}Test {coursename}{/urlencode}
)Screenshots
No response
Moodle version
Moodle 4.4.2+
Installed Moodle UI Language packs.
If other language(s), please specify
No response
Workaround
No response
Additional information
No response
System information
Client Device type: (e.g. Desktop, iPhone or iPad, Android phone or tablet, Other - specify) Client Operating System: (e.g. Windows, Linux, Mac OS, Android, iOS, Other - specify) Client Web Browser: (e.g. Chrome, Edge, Firefox, Safari, Safe Exam Browser, Moodle Mobile App) Server Operating System: (e.g. Windows, Linux, Mac OS, Other - specify) Server Webserver: (e.g. Apache, Nginx, IIS, Other - specify) Server PHP: (e.g. 7.4, 8.0, 8.1, 8.2, 8.3, Other - specify)
Code of Conduct