From 64dc8ec3b8510f4408f3fddb7a038cadeae9172f Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Tue, 17 Feb 2009 09:37:05 +0100 Subject: [PATCH] Fixed to prevent a crash when accessing the base page of a project with no /. When accessing the base page of a project without a trailing slash, the regex to get the project in the request object was not matching, resulting in a missing project in the request object. --- src/IDF/Middleware.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IDF/Middleware.php b/src/IDF/Middleware.php index 2028055..a4060af 100644 --- a/src/IDF/Middleware.php +++ b/src/IDF/Middleware.php @@ -44,7 +44,7 @@ class IDF_Middleware function process_request(&$request) { $match = array(); - if (preg_match('#^/(?:api/p|p)/([\-\w]+)/#', $request->query, $match)) { + if (preg_match('#^/(?:api/p|p)/([\-\w]+)/?#', $request->query, $match)) { try { $request->project = IDF_Project::getOr404($match[1]); } catch (Pluf_HTTP_Error404 $e) {