From 75910359d911c9a0df4761a46e554f9d0608744b Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 16 Sep 2014 10:53:29 +0000 Subject: [PATCH] route : Allow redirect from same URL to same URL if the method is changed git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1819 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- route.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/route.php b/route.php index 82a82ee..0e39720 100644 --- a/route.php +++ b/route.php @@ -129,7 +129,8 @@ class route // Else http : keep the complete URL if ($destURL === "") throw new Exception ("Destination URL is empty", 500); - if ($destURL === $requestURL) + // 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", 508); if (substr ($destURL, 0, strlen ($baseURL)) !== $baseURL) throw new Exception ("Can't redirect outside this site (Base $baseURL)",