From 5073d03454c9a4ef92ba93c26fa778a9c21fd607 Mon Sep 17 00:00:00 2001 From: Vadim Baryshev Date: Sun, 13 Apr 2014 13:15:46 +0400 Subject: [PATCH] Fix #1608 about Phalcon\Mvc\Router\Annotations Make it possible to define default route with `@Route('/')` annotation --- ext/mvc/router/annotations.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/mvc/router/annotations.c b/ext/mvc/router/annotations.c index e7b90950e38..52bdf901724 100644 --- a/ext/mvc/router/annotations.c +++ b/ext/mvc/router/annotations.c @@ -544,7 +544,11 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation){ PHALCON_INIT_VAR(uri); PHALCON_CONCAT_VV(uri, route_prefix, value); } else { - PHALCON_CPY_WRT(uri, route_prefix); + if (Z_TYPE_P(route_prefix) != IS_NULL) { + PHALCON_CPY_WRT(uri, route_prefix); + } else { + PHALCON_CPY_WRT(uri, value); + } } } else { PHALCON_INIT_NVAR(uri);