Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: distribution/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
- ===================================================================
- --- distribution/libs/sysplugins/smarty_internal_compile_private_function_plugin.php (revision 4052)
- +++ distribution/libs/sysplugins/smarty_internal_compile_private_function_plugin.php (working copy)
- @@ -16,6 +16,7 @@
- // attribute definitions
- public $required_attributes = array();
- public $optional_attributes = array('_any');
- + public $shorttag_order = array('_any');
- /**
- * Compiles code for the execution of function plugin
- @@ -41,18 +42,19 @@
- unset($_attr['nocache']);
- // convert attributes into parameter array string
- $_paramsArray = array();
- + $_plainParams = array();
- foreach ($_attr as $_key => $_value) {
- if (is_int($_key)) {
- - $_paramsArray[] = "$_key=>$_value";
- + $_plainParams[] = $_value;
- } else {
- $_paramsArray[] = "'$_key'=>$_value";
- }
- }
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
- // compile code
- - $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
- + $output = "<?php echo {$function}(".(empty ($_plainParams) ? '' : implode (', ', $_plainParams).', ')."{$_params},\$_smarty_tpl);?>\n";
- return $output;
- }
- }
- -?>
- \ No newline at end of file
- +?>
- Index: distribution/libs/sysplugins/smarty_internal_compilebase.php
- ===================================================================
- --- distribution/libs/sysplugins/smarty_internal_compilebase.php (revision 4052)
- +++ distribution/libs/sysplugins/smarty_internal_compilebase.php (working copy)
- @@ -41,6 +41,8 @@
- if (in_array(trim($mixed, '\'"'), $this->option_flags)) {
- $_indexed_attr[trim($mixed, '\'"')] = true;
- // shorthand attribute ?
- + } else if (@$this->shorttag_order[0] == '_any') {
- + $_indexed_attr[$key] = $mixed;
- } else if (isset($this->shorttag_order[$key])) {
- $_indexed_attr[$this->shorttag_order[$key]] = $mixed;
- } else {
- @@ -147,4 +149,4 @@
- }
- }
- -?>
- \ No newline at end of file
- +?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement