-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add properties files to htaccess rewrite condition #48692
base: master
Are you sure you want to change the base?
Conversation
/backport to stable30 |
/backport to stable29 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. <[email protected]>
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As agreed with @szaimen I will take over, as there are additional changes needed for the PDF viewer. Blocking to avoid merging until I can push them.
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)... |
@@ -487,7 +487,7 @@ public static function updateHtaccess(): bool { | |||
$content .= "\n Options -MultiViews"; | |||
$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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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$";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Fix #48691
This is needed for the PDF viewer localisation since it requests a
locale.properties
file.