From e4e7e0005e931967dd6162588f1c5913dbf4603e Mon Sep 17 00:00:00 2001
From: Yassine Doghri <yassine@doghri.fr>
Date: Thu, 20 Jan 2022 11:26:18 +0000
Subject: [PATCH] fix(themes): update themes stylesheet route and remove css
 extension

removing the css extension prevents having the file hijacked by the web server config
---
 app/Config/Routes.php                | 4 ++--
 app/Views/errors/html/error_404.php  | 2 +-
 app/Views/errors/html/production.php | 2 +-
 themes/cp_admin/_layout.php          | 2 +-
 themes/cp_app/embed.php              | 2 +-
 themes/cp_app/episode/_layout.php    | 2 +-
 themes/cp_app/home.php               | 2 +-
 themes/cp_app/pages/_layout.php      | 2 +-
 themes/cp_app/pages/map.php          | 2 +-
 themes/cp_app/podcast/_layout.php    | 2 +-
 themes/cp_app/podcast/follow.php     | 2 +-
 themes/cp_app/post/remote_action.php | 2 +-
 12 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index 077a76aebc..2ad119d64f 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -51,8 +51,8 @@ $routes->addPlaceholder(
 $routes->get('manifest.webmanifest', 'WebmanifestController', [
     'as' => 'webmanifest',
 ]);
-$routes->get('styles/themes.css', 'ColorsController', [
-    'as' => 'color-themes-css',
+$routes->get('themes/colors', 'ColorsController', [
+    'as' => 'themes-colors-css',
 ]);
 
 // We get a performance increase by specifying the default
diff --git a/app/Views/errors/html/error_404.php b/app/Views/errors/html/error_404.php
index 13cd335791..96a7517b25 100644
--- a/app/Views/errors/html/error_404.php
+++ b/app/Views/errors/html/error_404.php
@@ -5,7 +5,7 @@
 <head>
     <meta charset="utf-8">
     <title>404 Page Not Found</title>
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')->asset('styles/index.css', 'css') ?>
 </head>
 
diff --git a/app/Views/errors/html/production.php b/app/Views/errors/html/production.php
index f51eff00b7..8df9690283 100644
--- a/app/Views/errors/html/production.php
+++ b/app/Views/errors/html/production.php
@@ -7,7 +7,7 @@
 	<meta name="robots" content="noindex">
 
 	<title>Whoops!</title>
-	<link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+	<link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')->asset('styles/index.css', 'css') ?>
 </head>
 
diff --git a/themes/cp_admin/_layout.php b/themes/cp_admin/_layout.php
index d98d152f98..621e46fec0 100644
--- a/themes/cp_admin/_layout.php
+++ b/themes/cp_admin/_layout.php
@@ -14,7 +14,7 @@
     <link rel="apple-touch-icon" href="<?= service('settings')->get('App.siteIcon')['180'] ?>">
     <link rel="manifest" href="<?= route_to('webmanifest') ?>">
 
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
diff --git a/themes/cp_app/embed.php b/themes/cp_app/embed.php
index 55b3da0dc8..fcc375d2e2 100644
--- a/themes/cp_app/embed.php
+++ b/themes/cp_app/embed.php
@@ -12,7 +12,7 @@
     <link rel="icon" type="image/x-icon" href="<?= service('settings')
     ->get('App.siteIcon')['ico'] ?>" />
     <link rel="apple-touch-icon" href="<?= service('settings')->get('App.siteIcon')['180'] ?>">
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
diff --git a/themes/cp_app/episode/_layout.php b/themes/cp_app/episode/_layout.php
index b757aeca70..631082e61e 100644
--- a/themes/cp_app/episode/_layout.php
+++ b/themes/cp_app/episode/_layout.php
@@ -24,7 +24,7 @@
 
     <?= $metatags ?>
 
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
diff --git a/themes/cp_app/home.php b/themes/cp_app/home.php
index 0fd44330f9..64f494c39d 100644
--- a/themes/cp_app/home.php
+++ b/themes/cp_app/home.php
@@ -27,7 +27,7 @@
 
     <?= $metatags ?>
 
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
diff --git a/themes/cp_app/pages/_layout.php b/themes/cp_app/pages/_layout.php
index 060cbc64b6..839f577f22 100644
--- a/themes/cp_app/pages/_layout.php
+++ b/themes/cp_app/pages/_layout.php
@@ -23,7 +23,7 @@
 
     <?= $metatags ?>
 
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
diff --git a/themes/cp_app/pages/map.php b/themes/cp_app/pages/map.php
index a34980098e..83ebf4320d 100644
--- a/themes/cp_app/pages/map.php
+++ b/themes/cp_app/pages/map.php
@@ -26,7 +26,7 @@
     }
     </script>
 
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
diff --git a/themes/cp_app/podcast/_layout.php b/themes/cp_app/podcast/_layout.php
index 5027d2110f..f14d3437ee 100644
--- a/themes/cp_app/podcast/_layout.php
+++ b/themes/cp_app/podcast/_layout.php
@@ -24,7 +24,7 @@
 
     <?= $metatags ?>
 
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
diff --git a/themes/cp_app/podcast/follow.php b/themes/cp_app/podcast/follow.php
index e17cbd90d2..71245c7cda 100644
--- a/themes/cp_app/podcast/follow.php
+++ b/themes/cp_app/podcast/follow.php
@@ -24,7 +24,7 @@
 
     <?= $metatags ?>
 
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
diff --git a/themes/cp_app/post/remote_action.php b/themes/cp_app/post/remote_action.php
index 6103512d34..29e2e6a094 100644
--- a/themes/cp_app/post/remote_action.php
+++ b/themes/cp_app/post/remote_action.php
@@ -22,7 +22,7 @@
 
     <?= $metatags ?>
 
-    <link rel='stylesheet' type='text/css' href='<?= route_to('color-themes-css') ?>' />
+    <link rel='stylesheet' type='text/css' href='<?= route_to('themes-colors-css') ?>' />
     <?= service('vite')
         ->asset('styles/index.css', 'css') ?>
     <?= service('vite')
-- 
GitLab