From e8c179409b079e32bb34f3a9a912444c9ebe81e4 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Thu, 16 Jan 2014 06:12:04 +0200 Subject: [PATCH 1/3] Fix #1828 --- ext/mvc/view/engine/volt/compiler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/mvc/view/engine/volt/compiler.c b/ext/mvc/view/engine/volt/compiler.c index 018a22e9e95..6f95cd17816 100644 --- a/ext/mvc/view/engine/volt/compiler.c +++ b/ext/mvc/view/engine/volt/compiler.c @@ -479,7 +479,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addExtension){ zval *extension; - phalcon_fetch_params(1, 1, 0, &extension); + phalcon_fetch_params(0, 1, 0, &extension); if (Z_TYPE_P(extension) != IS_OBJECT) { PHALCON_THROW_EXCEPTION_STRW(phalcon_mvc_view_exception_ce, "The extension is not valid"); @@ -550,7 +550,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addFilter){ zval **name, **definition; - phalcon_fetch_params(0, 2, 0, &name, &definition); + phalcon_fetch_params_ex(2, 0, &name, &definition); PHALCON_ENSURE_IS_STRING(name); phalcon_update_property_array(this_ptr, SL("_filters"), *name, *definition TSRMLS_CC); From 8ac3fa102da551c55156e55c26af6828432c6059 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Thu, 16 Jan 2014 06:13:19 +0200 Subject: [PATCH 2/3] Test case for #1828 --- ext/tests/issue-1828.phpt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ext/tests/issue-1828.phpt diff --git a/ext/tests/issue-1828.phpt b/ext/tests/issue-1828.phpt new file mode 100644 index 00000000000..0841c5d69ae --- /dev/null +++ b/ext/tests/issue-1828.phpt @@ -0,0 +1,21 @@ +--TEST-- +$view->addFilter does not work in 1.3.0 - https://github.com/phalcon/cphalcon/issues/1828 +--SKIPIF-- + +--FILE-- +setOptions(array( + "compiledPath" => '', + "compiledExtension" => ".compiled", +)); + +$volt->getCompiler()->addFilter('myfilter', 'md5'); +$volt->getCompiler()->addFilter('myfilter', function () { + return 'somevalue'; +}); +?> +--EXPECT-- From 0b203326e470b6169dc4e010a3618161adea86a1 Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Thu, 16 Jan 2014 06:15:36 +0200 Subject: [PATCH 3/3] Added CHANGELOG --- CHANGELOG | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ecbcf876df1..161b44a786e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,13 +1,13 @@ 1.3.0 - Make the source code compatible with PHP 5.6-dev and PHP 5.7-dev (#1762) - Code cleanup: get rid of compiler warnings, dead code elimination, code deduplication, use static code analysers to eliminate possible bugs - (#801, #802, #810, #825, #827, #838, #849, #942, #968, #1001, #1093, #1169, #1214, #1223, #1224, #1375, #1430, #1787, #1794) + (#801, #802, #810, #825, #827, #838, #849, #942, #968, #1001, #1093, #1169, #1214, #1223, #1224, #1375, #1430, #1787, #1794, #1828) - Fixed various memory leaks (#469, #860, #910, #914, #916, #1031, #1067, #1249, #1273, #1291, #1309, #1345, #1455, #1470, #1700) - Fixed memory access violations / segmentation faults / etc (#469, #849, #851, #852, #858, #860, #861, #895, #911, #918, #927, #928, #1000, #1077, #1112, #1113, #1131, #1149, #1173, #1272, #1284, #1302, #1340, #1343, #1368, #1369, #1371, #1376, #1379, #1392, #1451, #1466, #1485, #1494, #1501, #1504, #1509, #1567, #1607) - Fixed PHP notices, warnings and other incompatibilities (#894, #1222, #1315, #1413, #1427, #1428, #1529) - Fixed inheritance chain for Phalcon\Forms\Exception, Phalcon\Loader\Exception, Phalcon\Http\Request\Exception (#1770) - - Major source coede optimizations (#1785) + - Major source code optimizations (#1785) - Control Phalcon behavior via INI settings (#1796) - Security fixes: - Hardening fixes (#1044) @@ -41,6 +41,7 @@ - Fix misleading diagnostics on exception (#1297) - Use preallocated permanent zvals instead of null, true, false, 0 and 1 (#1302) - Bug fix in phalcon_fix_path() (#1591) + - Persistent function cache for Phalcon methods (#1825) - Phalcon\Acl: - Fixed broken ACL inheritance (#905) - Bug fix when ACL allowed access to forbidden resources (#1303)