diff --git a/route.php b/route.php index a7bb3ff..ddd4213 100644 --- a/route.php +++ b/route.php @@ -240,13 +240,14 @@ class route // Else http : keep the complete URL if ($destURL === "") - throw new Exception ("Destination URL is empty", 500); + $this->error (new \Exception ("Destination URL is empty", 500)); // Allow to redirect from POST to GET, but not GET to GET (can loop) if ($destURL === $requestURL && $_SERVER["REQUEST_METHOD"] === "GET") - throw new Exception ("Redirect to myself", 400); + $this->error (new \Exception ("Redirect to myself", 400)); if (substr_count ($baseURL, "../") > 1+ substr_count ($destURL,"/")) - throw new Exception ("Can't redirect outside this site (Base $baseURL)", - 405); + $this->error (new \Exception ( + "Can't redirect outside this site (Base $baseURL)", + 405)); if ($this->debug) { @@ -461,7 +462,7 @@ class route $_SESSION["domframework"]["route"]["lastGet"] = "/".$this->requestURL (); } - catch (Exception $e) + catch (\Exception $e) { $this->error ($e); } @@ -517,7 +518,7 @@ class route $_SESSION["domframework"]["route"]["lastGet"] = "/".$this->requestURL (); } - catch (Exception $e) + catch (\Exception $e) { $this->error ($e); } @@ -573,7 +574,7 @@ class route $message .= "

The Exception code was 0 and converted to 500

\n"; } } - catch (Exception $e) + catch (\Exception $e) { // If there is an error with the ratelimiter (file not writeable...), // overload the Exception