From 2d124e4aabdc2f4c5a30c5b0b087bbfa1e7bac7b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 22 Oct 2010 13:51:28 -0700 Subject: [PATCH] Fix for ticket #2532: fixed API block create/destroy when specifying the target user/profile as a separate query parameter, such as api/blocks/create.xml?param=xxx The router settings weren't quite right so we ended up with bogus regex values passed in as the 'id' parameter, which broke the regular fallback ordering of parameter checks. --- lib/router.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/router.php b/lib/router.php index ab8c40668d..9aaac7dfe3 100644 --- a/lib/router.php +++ b/lib/router.php @@ -551,11 +551,19 @@ class Router 'format' => '(xml|json)')); // blocks + $m->connect('api/blocks/create.:format', + array('action' => 'ApiBlockCreate', + 'format' => '(xml|json)')); + $m->connect('api/blocks/create/:id.:format', array('action' => 'ApiBlockCreate', 'id' => '[a-zA-Z0-9]+', 'format' => '(xml|json)')); + $m->connect('api/blocks/destroy.:format', + array('action' => 'ApiBlockDestroy', + 'format' => '(xml|json)')); + $m->connect('api/blocks/destroy/:id.:format', array('action' => 'ApiBlockDestroy', 'id' => '[a-zA-Z0-9]+',