Bugzilla – Attachment 71537 Details for
Bug 20187
New rewrite rules can break custom css
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20187: New rewrite rules can break custom css
Bug-20187-New-rewrite-rules-can-break-custom-css.patch (text/plain), 3.86 KB, created by
Kyle M Hall
on 2018-02-13 13:24:04 UTC
(
hide
)
Description:
Bug 20187: New rewrite rules can break custom css
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2018-02-13 13:24:04 UTC
Size:
3.86 KB
patch
obsolete
>From d29e21ef8c07f50abbc8b084d6c559f19be41100 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 13 Feb 2018 13:20:24 +0000 >Subject: [PATCH] Bug 20187: New rewrite rules can break custom css > >Koha has the ability to include custom css in the apache configuration. >If a library has any custom css ( or adds a custom js file in some way ), >and that file has an underscore in it ( e.g. my_custom.css ), the >apache rewrite rule will convert it to my.css and thus it will 404. > >We should make the rewrite rules as specific as possible for the >format we are using. > >Test Plan: >1) Set OPAC_CSS_OVERRIDE to a file with an underscore in it >2) Note it does not work >3) Apply this patch >4) Update the apache rewrite rules to match those in the patch > For kohadevbox, just run /home/vagrant/misc4dev/cp_debian_files.pl >5) Restart apache >6) Reload the page, your custom css should load now! >--- > debian/templates/apache-shared-intranet.conf | 4 ++-- > debian/templates/apache-shared-opac.conf | 4 ++-- > etc/koha-httpd.conf | 8 ++++---- > 3 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/debian/templates/apache-shared-intranet.conf b/debian/templates/apache-shared-intranet.conf >index 0fb4fdb..fd4a4d9 100644 >--- a/debian/templates/apache-shared-intranet.conf >+++ b/debian/templates/apache-shared-intranet.conf >@@ -17,8 +17,8 @@ RewriteRule (.+) $1?%1%2 [N,R,NE] > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >-RewriteRule ^(.*)_(.*).js$ $1.js [N,L] >-RewriteRule ^(.*)_(.*).css$ $1.css [N,L] >+RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].js$ $1.js [N,L] >+RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].css$ $1.css [N,L] > > Alias "/api" "/usr/share/koha/api" > <Directory "/usr/share/koha/api"> >diff --git a/debian/templates/apache-shared-opac.conf b/debian/templates/apache-shared-opac.conf >index e63ab1c..68823a4 100644 >--- a/debian/templates/apache-shared-opac.conf >+++ b/debian/templates/apache-shared-opac.conf >@@ -17,8 +17,8 @@ RewriteRule (.+) $1?%1%2 [N,R,NE] > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >-RewriteRule ^(.*)_(.*).js$ $1.js [N,L] >-RewriteRule ^(.*)_(.*).css$ $1.css [N,L] >+RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].js$ $1.js [N,L] >+RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].css$ $1.css [N,L] > > <IfVersion >= 2.4> > AliasMatch "^/sitemap(.*)" "/var/lib/koha/${instance}/sitemap/sitemap$1" >diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf >index 327956f..2fed351 100644 >--- a/etc/koha-httpd.conf >+++ b/etc/koha-httpd.conf >@@ -111,8 +111,8 @@ > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >- RewriteRule ^(.*)_(.*).js$ $1.js [N,L] >- RewriteRule ^(.*)_(.*).css$ $1.css [N,L] >+ RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].js$ $1.js [N,L] >+ RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].css$ $1.css [N,L] > > # REST API configuration > Alias "/api" "__API_CGI_DIR__" >@@ -238,8 +238,8 @@ > RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT] > RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] > RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] >- RewriteRule ^(.*)_(.*).js$ $1.js [N,L] >- RewriteRule ^(.*)_(.*).css$ $1.css [N,L] >+ RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].js$ $1.js [N,L] >+ RewriteRule ^(.*)_[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9].css$ $1.css [N,L] > > > # REST API configuration >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20187
:
71537
|
71538
|
71541
|
71542
|
71544
|
71545
|
71547
|
71554