From fa4aa64cdca0f0afbd843bc266582667b00bf018 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Wed, 11 Dec 2013 08:33:42 +0200 Subject: [PATCH 1/3] Fix #1556 --- ext/mvc/router.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mvc/router.c b/ext/mvc/router.c index 5dfb5e9e477..75f48299c5d 100644 --- a/ext/mvc/router.c +++ b/ext/mvc/router.c @@ -714,7 +714,7 @@ PHP_METHOD(Phalcon_Mvc_Router, handle){ * Call the function in the PHP userland */ PHALCON_INIT_NVAR(route_found); - PHALCON_CALL_USER_FUNC_ARRAY(route_found, before_match, params); + PHALCON_CALL_USER_FUNC_ARRAY(route_found, before_match, before_match_params); } } From 136bd3c414cc762268d01698b329958369c9d929 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Wed, 11 Dec 2013 08:33:57 +0200 Subject: [PATCH 2/3] Test for #1556 --- ext/tests/issue-1556.phpt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ext/tests/issue-1556.phpt diff --git a/ext/tests/issue-1556.phpt b/ext/tests/issue-1556.phpt new file mode 100644 index 00000000000..4172dc54894 --- /dev/null +++ b/ext/tests/issue-1556.phpt @@ -0,0 +1,25 @@ +--TEST-- +Missing arguments 1, 2 for closure in beforeMatch - https://github.com/phalcon/cphalcon/issues/1556 +--SKIPIF-- + +--FILE-- +add('/test')->beforeMatch( + function($uri, $route, $router) + { + echo $uri, PHP_EOL; + echo get_class($route), PHP_EOL; + echo get_class($router), PHP_EOL; + return true; + } +); + +$router->handle('/test'); +?> +--EXPECT-- +/test +Phalcon\Mvc\Router\Route +Phalcon\Mvc\Router From 3f67da41b8db2bb1926567b65f086930f56e3dfc Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Wed, 11 Dec 2013 08:35:16 +0200 Subject: [PATCH 3/3] Updated changelog --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index db10f2326fc..9571621db2c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -179,6 +179,7 @@ - Added Phalcon\Mvc\Model::selectWriteConnection() (#1519) - Added Phalcon\Mvc\Router\Group::convert()/getConverters() (#1555, #1572) - Faster Phalcon\Mvc\Model\Row (#1606) + - Bug fix: no arguments were passed to beforeMatch handler in Phalcon\Mvc\Router (#1556) - Phalcon\Flash: - Phalcon\Flash\Session::getMessage('key') returns now an empty array if the key is not found (#908, #920) - Phalcon\Flash\Session::getMessages() incorrectly removed all messages (#1575)