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.
This commit is contained in:
parent
d1b139bb30
commit
64dc8ec3b8
@ -44,7 +44,7 @@ class IDF_Middleware
|
|||||||
function process_request(&$request)
|
function process_request(&$request)
|
||||||
{
|
{
|
||||||
$match = array();
|
$match = array();
|
||||||
if (preg_match('#^/(?:api/p|p)/([\-\w]+)/#', $request->query, $match)) {
|
if (preg_match('#^/(?:api/p|p)/([\-\w]+)/?#', $request->query, $match)) {
|
||||||
try {
|
try {
|
||||||
$request->project = IDF_Project::getOr404($match[1]);
|
$request->project = IDF_Project::getOr404($match[1]);
|
||||||
} catch (Pluf_HTTP_Error404 $e) {
|
} catch (Pluf_HTTP_Error404 $e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user