From 6e67b1f42169dd6c72adaa04b7706625a6afe982 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Wed, 15 Jan 2025 12:23:19 +0100
Subject: [PATCH] add test link for regex ".*"

---
 public_html/admin/index.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/public_html/admin/index.php b/public_html/admin/index.php
index 9076f48..7518eed 100644
--- a/public_html/admin/index.php
+++ b/public_html/admin/index.php
@@ -144,7 +144,15 @@ if (!$oR->isEnabled()) {
                 if (count($aCfg['redirects'][$sType])) {
                     foreach ($aCfg['redirects'][$sType] as $sFrom => $aTo) {
                         $iCount++;
-                        $sRelFrom = $sType == 'direct' ? $sFrom : ($aTo['link'] ?? false );
+                        switch ($sType) {
+                            case 'direct':
+                                $sRelFrom = $sFrom;
+                                break;
+                            case 'regex':
+                                $sRelFrom = $aTo['link'] ?? false;
+                                break;
+                        }
+
                         $sTable .= $sTdFirst
                             . '<td class="type-' . $sType . '">' . $sType . '</td>'
                             . '<td class="type-' . $sType . '">'
@@ -268,7 +276,7 @@ if (!$oR->isEnabled()) {
 </head>
 
 <body>
-    <h1><a href="?"> Redirects :: admin</a></h1>
+    <h1><a href="?"><?php echo $oR->getTitle(); ?></a></h1>
 
     <main>
         <?php echo $sErrors . $sHtml; ?>
-- 
GitLab