]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - header.php
Fix crash from previous commit
[irc/unrealircd/unrealircd-webpanel.git] / header.php
index 364ba2584dce19a67bdc5fa7d2dac38c82adb09e..1ad2a8d6451fa7461d796b8d4fec813b22935ec8 100644 (file)
@@ -1,3 +1,4 @@
+<?php $arr = []; Hook::run(HOOKTYPE_PRE_HEADER, $arr); ?>
 <!DOCTYPE html>
 <head>
  <!-- Latest compiled and minified CSS -->
@@ -18,7 +19,7 @@
 <script src="<?php echo BASE_URL; ?>js/unrealircd-admin.js"></script>
 <title>UnrealIRCd Panel</title>
 <link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico">
-<link href="<?php echo UPATH; ?>css/unrealircd-admin.css" rel="stylesheet">
+<link href="<?php echo BASE_URL; ?>css/unrealircd-admin.css" rel="stylesheet">
 </head>
 <body role="document">
 <div class="container-fluid">
        <!-- Fixed navbar -->
        <nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top">
                <ul class="nav navbar-nav">
-                       <a class="navbar-brand" href="<?php echo BASE_URL; ?>/index.php"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
+                       <a class="navbar-brand" href="<?php echo BASE_URL; ?>"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
 <?php
 
 $active_page = NULL;
-/* Needs to be a separate step due to multiple matches */
+
 foreach ($pages as $name => $page)
 {
        $script = $_SERVER['SCRIPT_FILENAME'];
-       if (str_ends_with($script, BASE_URL . "index.php") || !strlen($page))
-       {
+       $tok = split($script, "/");
+       if (strlen($page) == 0) {
                $active_page = "";
        }
+       else if (str_ends_with($script, BASE_URL . "index.php") && BASE_URL != "/" && !strlen($tok[0]))
+       {
+               $active_page = $tok[0];
+       }
        else if (!str_ends_with($page, ".php"))
        {
                $script2 = rtrim($script, "/index.php");