From 537e0e1b950526ecce4ae84def4d679fa26d5d33 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Tue, 14 Jan 2025 10:50:40 +0100
Subject: [PATCH 1/2] small optical fixes

---
 public_html/admin/index.php                  | 10 +++++-----
 public_html/classes/redirect.admin.class.php |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/public_html/admin/index.php b/public_html/admin/index.php
index daf6455..9076f48 100644
--- a/public_html/admin/index.php
+++ b/public_html/admin/index.php
@@ -24,7 +24,6 @@ $sHtml = '';
 $sErrors = '';
 
 $aIco = [
-    'h2_err' => '⚠️',
     'h2_config' => '🛠️',
     'h2_file' => '📄',
 
@@ -32,6 +31,8 @@ $aIco = [
     'ip_warn' => '🟠',
     'ip_err' => '❗',
 
+    'error' => '❗',
+
     'type_config' => '🔷',
     'type_alias' => '▪️',
 
@@ -89,7 +90,7 @@ if (!$oR->isEnabled()) {
 
     $sMyIp = gethostbyname($_SERVER['SERVER_NAME']);
     if (!$sMyIp) {
-        $sErrors .= '<li>Ip address of current host [' . $_SERVER['SERVER_NAME'] . '] was not found.</li>';
+        $sErrors .= '<li>'.$aIco['error'].' Ip address of current host [' . $_SERVER['SERVER_NAME'] . '] was not found.</li>';
     }
 
     // ---------- GET CONFIG DATA
@@ -99,7 +100,7 @@ if (!$oR->isEnabled()) {
     // ---------- SHOW ERRORS
 
     if (count($aHosts['_errors'])) {
-        $sErrors .= '<li>' . implode('</li><li>', $aHosts['_errors']) . '</li>';
+        $sErrors .= '<li>'.$aIco['error'].' ' . implode('</li><li>'.$aIco['error'].' ', $aHosts['_errors']) . '</li>';
     }
     unset($aHosts['_errors']);
 
@@ -238,8 +239,7 @@ if (!$oR->isEnabled()) {
     ;
 
     $sErrors = $sErrors
-        ? '<!-- <h2>' . $aIco['h2_err'] . ' Found errors</h2> -->'
-        . '<ol class="error">'
+        ? '<ol class="error">'
         . $sErrors
         . '</ol>'
         : ''
diff --git a/public_html/classes/redirect.admin.class.php b/public_html/classes/redirect.admin.class.php
index b1b66cf..92979e1 100644
--- a/public_html/classes/redirect.admin.class.php
+++ b/public_html/classes/redirect.admin.class.php
@@ -141,8 +141,8 @@ class redirectadmin extends redirect
             $iHops = (count($aTmp[0]) - 1);
 
             $sReturn = ($iHops > 0
-                ? 'Found hops: <strong>' . $iHops . '</strong>'
-                . ($iHops > 1 ? ' <span class="warning"> ⚠️ Verify your redirect to skip unneeded hops.</span>' : '') . '<br><br>'
+                ? '<br>Found hops: <strong>' . $iHops . '</strong>'
+                . ($iHops > 1 ? ' <br><span class="warning"> ⚠️ Verify your redirect to skip unneeded hops.</span>' : '') . '<br><br>'
                 : ''
             ) . $sReturn
             ;
-- 
GitLab


From b657e76f7823f05530012f05c4080baf1c224b5b Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Tue, 14 Jan 2025 10:51:02 +0100
Subject: [PATCH 2/2] update docs: desribe link entry for regex redirects

---
 "docs/30_\342\232\231\357\270\217_Configuration.md" | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git "a/docs/30_\342\232\231\357\270\217_Configuration.md" "b/docs/30_\342\232\231\357\270\217_Configuration.md"
index cb6580c..05fa791 100644
--- "a/docs/30_\342\232\231\357\270\217_Configuration.md"
+++ "b/docs/30_\342\232\231\357\270\217_Configuration.md"
@@ -28,9 +28,9 @@ Let's start with an example for a `redirects_<FQDN>.json`:
     },
 
     "regex":{
-        "^/$":      {"code": 307, "target": "https://www.iml.unibe.ch" },
-        "^/ax.l.*": {"code": 307, "target": "https://www.axel-hahn.de" },
-        ".*":       {"code": 301, "target": "https://www2.example.com" }
+        "^/$":      {"code": 307, "target": "https://www.iml.unibe.ch", "link": "/"         },
+        "^/ax.l.*": {"code": 307, "target": "https://www.axel-hahn.de", "link": "/axelhahn" },
+        ".*":       {"code": 301, "target": "https://www2.example.com", "link": "/testme"   }
     }
 }
 ```
@@ -72,6 +72,7 @@ Both redirect section contain a redirect definition
 
 * code - http status code for redirection
 * target - target url of the redirect
+* link - optional, for regex only: set a path for a test link
 
 Status codes
 
-- 
GitLab