From d1ed7f01d076acec20431a035de7931f3e0e294d Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Thu, 23 Mar 2017 16:53:24 +0100
Subject: [PATCH] fix route rest if custom

---
 core/class/class_core_tools.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/class/class_core_tools.php b/core/class/class_core_tools.php
index 4380ef27c9a..6e7d98c9eeb 100755
--- a/core/class/class_core_tools.php
+++ b/core/class/class_core_tools.php
@@ -2360,6 +2360,10 @@ class core_tools extends functions
         }
         $linkToApps = false;
             $arr = explode('/', $_SERVER['SCRIPT_NAME']);
+        if($key = array_search('rest',$arr)){
+            unset($arr[$key]);
+        }
+        $arr = array_values($arr);
         for($cptArr=0;$cptArr<count($arr);$cptArr++) {
             if($arr[$cptArr] == "apps") {
                 $linkToApps = true;
-- 
GitLab