@@ -60,13 +60,13 @@ class Template implements \Zend_Filter_Interface
60
60
* @var string[]
61
61
*/
62
62
private $ restrictedMethods = [
63
- 'addafterfiltercallback ' ,
64
63
'getresourcecollection ' ,
65
64
'load ' ,
66
65
'save ' ,
67
66
'getcollection ' ,
68
67
'getresource ' ,
69
68
'getconfig ' ,
69
+ 'delete ' ,
70
70
];
71
71
72
72
/**
@@ -314,25 +314,6 @@ protected function getParameters($value)
314
314
return $ params ;
315
315
}
316
316
317
- /**
318
- * Validate method call initiated in a template.
319
- *
320
- * Deny calls for methods that may disrupt template processing.
321
- *
322
- * @param object $object
323
- * @param string $method
324
- * @return void
325
- * @throws \InvalidArgumentException
326
- */
327
- private function validateVariableMethodCall ($ object , $ method )
328
- {
329
- if ($ object === $ this ) {
330
- if (in_array (mb_strtolower ($ method ), $ this ->restrictedMethods )) {
331
- throw new \InvalidArgumentException ("Method $ method cannot be called from template. " );
332
- }
333
- }
334
- }
335
-
336
317
/**
337
318
* Check allowed methods for data objects.
338
319
*
@@ -402,19 +383,6 @@ protected function getVariable($value, $default = '{no_value_defined}')
402
383
}
403
384
}
404
385
$ last = $ i ;
405
- } elseif (isset ($ stackVars [$ i - 1 ]['variable ' ])
406
- && is_object ($ stackVars [$ i - 1 ]['variable ' ])
407
- && $ stackVars [$ i ]['type ' ] == 'method '
408
- ) {
409
- // Calling object methods
410
- $ object = $ stackVars [$ i - 1 ]['variable ' ];
411
- $ method = $ stackVars [$ i ]['name ' ];
412
- if (method_exists ($ object , $ method )) {
413
- $ args = $ this ->getStackArgs ($ stackVars [$ i ]['args ' ]);
414
- $ this ->validateVariableMethodCall ($ object , $ method );
415
- $ stackVars [$ i ]['variable ' ] = call_user_func_array ([$ object , $ method ], $ args );
416
- }
417
- $ last = $ i ;
418
386
}
419
387
}
420
388
0 commit comments