Skip to content

fix: add properties files to htaccess rewrite condition - #48692

Closed
szaimen wants to merge 1 commit into
masterfrom
enh/noid/fix-properties-files
Closed

fix: add properties files to htaccess rewrite condition#48692
szaimen wants to merge 1 commit into
masterfrom
enh/noid/fix-properties-files

Conversation

@szaimen

@szaimenszaimen commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

Fixnextcloud/files_pdfviewer#1191

This is needed for the PDF viewer localisation since it requests a locale.properties file.

@szaimenszaimen added bug 3. to review Waiting for reviews labels Oct 14, 2024
@szaimenszaimen added this to the Nextcloud 31 milestone Oct 14, 2024
@szaimen

Copy link
Copy Markdown
ContributorAuthor

/backport to stable30

@szaimen

Copy link
Copy Markdown
ContributorAuthor

/backport to stable29

@danxuliudanxuliu left a comment

Copy link
Copy Markdown
Member

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. <szaimen@e.mail.de>
@szaimen
szaimenforce-pushed the enh/noid/fix-properties-files branch from b4b56ce to d4b0309CompareOctober 14, 2024 13:12
@szaimen

Copy link
Copy Markdown
ContributorAuthor

Could you add a little mention in the commit message that this is needed for PDF viewer localisation? Thanks!

done

@joshtrichards

Copy link
Copy Markdown
Member

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...

@nickvergessen

Copy link
Copy Markdown
Member

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?

Yeah well mostlikely when the upstream library changed it's way of handling things

Because we'll need this in our Admin Manual's nginx config too...

Yes, please add similarly to nextcloud/documentation#12273

@nickvergessennickvergessen added the pending documentation This pull request needs an associated documentation update label Oct 14, 2024

@danxuliudanxuliu left a comment

Copy link
Copy Markdown
Member

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.

@susnux

Copy link
Copy Markdown
Contributor

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 try_files for apps/xxx/js/...?

@szaimen

Copy link
Copy Markdown
ContributorAuthor

I wonder why this is working using just the default Apache htaccess? (currently it works for me without any changes).

I suppose you did not enable pretty urls? (they are active for AIO by default)...

Comment threadlib/private/Setup.php
$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)$";

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member

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$";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@skjnldsvskjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Oct 29, 2024
@blizzzblizzz mentioned this pull request Jan 8, 2025
This was referenced Jan 14, 2025
This was referenced Jan 21, 2025
@blizzzblizzz mentioned this pull request Jan 29, 2025
1 task
@blizzzblizzz modified the milestones: Nextcloud 31, Nextcloud 32Jan 29, 2025
This was referenced Sep 25, 2025
This was referenced Jan 7, 2026
This was referenced Jan 14, 2026
@nextcloud-botnextcloud-bot mentioned this pull request Jan 22, 2026
This was referenced Jan 29, 2026
This was referenced Feb 11, 2026
@blizzzblizzz modified the milestones: Nextcloud 33, Nextcloud 34Feb 16, 2026
@DorraJaouad
DorraJaouad requested a review from a team as a code ownerApril 23, 2026 09:41
@DorraJaouad
DorraJaouad requested review from artonge, come-nc, leftybournes and nfebe and removed request for a teamApril 23, 2026 09:41
@come-nc
come-nc removed their request for review April 27, 2026 13:59
@nextcloud-botnextcloud-bot mentioned this pull request May 27, 2026
@nextcloud-botnextcloud-bot mentioned this pull request Jun 4, 2026
This was referenced Jun 5, 2026
@szaimenszaimen closed this Jun 8, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developingWork in progressbackport-requestbugpending documentationThis pull request needs an associated documentation update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files_pdfviewer : localisation doesn't work with NC 29.0.7

9 participants

@szaimen@joshtrichards@nickvergessen@susnux@provokateurin@danxuliu@blizzz@skjnldsv@nextcloud-bot