revolution
revolution copied to clipboard
Can't make .htaccess editable from manager in 3.0
Bug report
Summary
In 2.x, adding htaccess
to the upload_files
system setting would allow you to edit .htaccess files from the manager. That doesn't seem to work in 3.0.1 anymore.
Step to reproduce
Add htaccess
to the upload_files
system setting.
Observed behavior
Error File extension `` is not permitted.
Expected behavior
Allow editing .htaccess files when opted in.
Environment
Probably all.
The problem seems to be this line in the sanitize function that removes the dot from the file name. https://github.com/modxcms/revolution/blob/26866e13963084610bb03c89b635654813f55a86/core/src/Revolution/Processors/Browser/Browser.php#L146
Maybe that can be restricted to two starting dots: #^(\.{2}|/)+#u
Should be safe: https://regex101.com/r/FbuRLQ/1
The dot files have to be restricted elsewhere.
Maybe that can be restricted to two starting dots:
#^(\.{2}|/)+#u
Should be safe: https://regex101.com/r/FbuRLQ/1
The dot files have to be restricted elsewhere.
That's also how it's done in 2.x: https://github.com/modxcms/revolution/commit/74044ab4fcadb4ad65b9cc5e485e1a2ee737b2c4