Browse Source

Routes fix

Roman Hergenreder 3 years ago
parent
commit
abb8b07a02

+ 1 - 1
core/Api/Routes/Find.class.php

@@ -34,7 +34,7 @@ class Find extends Request {
       ->select("uid", "request", "action", "target", "extra")
       ->from("Route")
       ->where(new CondBool("active"))
-      ->where(new Regex("^$request$", new Column("request")))
+      ->where(new Regex($request, new Column("request")))
       ->limit(1)
       ->execute();
 

+ 1 - 1
core/Configuration/CreateDatabase.class.php

@@ -129,7 +129,7 @@ class CreateDatabase {
       ->primaryKey("uid");
 
     $queries[] = $sql->insert("Route", array("request", "action", "target"))
-      ->addRow("/admin(/.*)?", "dynamic", "\\Documents\\AdminDashboard");
+      ->addRow("^/admin(/.*)?$", "dynamic", "\\Documents\\AdminDashboard");
 
     return $queries;
   }

+ 3 - 3
index.php

@@ -84,15 +84,15 @@ if(isset($_GET["api"]) && is_string($_GET["api"])) {
         $target = trim(explode("\n", $route["target"])[0]);
         switch ($route["action"]) {
           case "redirect_temporary":
-            http_send_status(307);
+            http_response_code(307);
             header("Location: $target");
             break;
           case "redirect_permanently":
-            http_send_status(308);
+            http_response_code(308);
             header("Location: $target");
             break;
           case "static":
-            http_send_status(501);
+            http_response_code(501);
             $response = "Not implemented yet.";
             break;
           case "dynamic":

File diff suppressed because it is too large
+ 0 - 0
js/admin.min.js


+ 1 - 1
src/src/views/pages.js

@@ -133,7 +133,7 @@ export default class PageOverview extends React.Component {
                                                   data-tip={"The request, the user is making. Can also be interpreted as a regular expression."}
                                                   data-type={"info"} data-place={"bottom"}/>
                                         </th>
-                                        <th style={{minWidth: "250px"}}>
+                                        <th style={{minWidth: "200px"}}>
                                             Action&nbsp;
                                             <Icon icon={"question-circle"} style={{"color": "#17a2b8"}}
                                                   data-tip={"The action to be taken"}

Some files were not shown because too many files changed in this diff