Skip to content

Commit

Permalink
Merge pull request #1831 from sjinks/issue-1828
Browse files Browse the repository at this point in the history
Fix #1828
  • Loading branch information
Phalcon committed Jan 16, 2014
2 parents ddf2228 + 0b20332 commit dc5ec73
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions ext/mvc/view/engine/volt/compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down
21 changes: 21 additions & 0 deletions ext/tests/issue-1828.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--TEST--
$view->addFilter does not work in 1.3.0 - https://github.com/phalcon/cphalcon/issues/1828
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

$view = new \Phalcon\Mvc\View();
$di = new \Phalcon\DI\FactoryDefault();
$volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
$volt->setOptions(array(
"compiledPath" => '',
"compiledExtension" => ".compiled",
));

$volt->getCompiler()->addFilter('myfilter', 'md5');
$volt->getCompiler()->addFilter('myfilter', function () {
return 'somevalue';
});
?>
--EXPECT--

0 comments on commit dc5ec73

Please sign in to comment.