fix: add properties files to htaccess rewrite condition#48692
fix: add properties files to htaccess rewrite condition#48692
Conversation
|
/backport to stable30 |
|
/backport to stable29 |
danxuliu
left a comment
There was a problem hiding this comment.
Could you add a little mention in the commit message that this is needed for PDF viewer localisation? Thanks!
This is needed for the PDF viewer localisation since it requests a `locale.properties` file. Signed-off-by: Simon L. <szaimen@e.mail.de>
b4b56ce to
d4b0309
Compare
done |
|
Haven't looked too closely yet, but off-hand this type of change suggests there was perhaps also a breaking change introduced at some point, no? Because we'll need this in our Admin Manual's nginx config too... |
Yeah well mostlikely when the upstream library changed it's way of handling things
Yes, please add similarly to nextcloud/documentation#12273 |
|
I wonder why this is working using just the default Apache htaccess? (currently it works for me without any changes). But in general maybe this should be changed to the Apache equivalent of |
I suppose you did not enable pretty urls? (they are active for AIO by default)... |
| $content .= "\n RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]"; | ||
| $content .= "\n RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]"; | ||
| $content .= "\n RewriteCond %{REQUEST_FILENAME} !\\.(css|js|mjs|svg|gif|ico|jpg|jpeg|png|webp|html|otf|ttf|woff2?|map|webm|mp4|mp3|ogg|wav|flac|wasm|tflite)$"; | ||
| $content .= "\n RewriteCond %{REQUEST_FILENAME} !\\.(css|js|mjs|svg|gif|ico|jpg|jpeg|png|webp|html|otf|ttf|woff2?|map|webm|mp4|mp3|ogg|wav|flac|wasm|tflite|properties)$"; |
There was a problem hiding this comment.
This feels dangerous to me. There could be other .properties files that should rather not get exposed by accident. Can you instead add a pattern that matches the exact file name only?
There was a problem hiding this comment.
The properties files come from PDF.js locales; there is a main locale.properties and one XXX/viewer.properties for each locale, where XXX is the locale code.
Does something like this would be enough or you would prefer something even stricter?:
$content .= "\n RewriteCond %{REQUEST_FILENAME} !pdfjs/.*/(locale|viewer)\\.properties$";
Fix nextcloud/files_pdfviewer#1191
This is needed for the PDF viewer localisation since it requests a
locale.propertiesfile.