Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2011
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. Index: distribution/libs/sysplugins/smarty_internal_compile_private_function_plugin.php
  2. ===================================================================
  3. --- distribution/libs/sysplugins/smarty_internal_compile_private_function_plugin.php (revision 4052)
  4. +++ distribution/libs/sysplugins/smarty_internal_compile_private_function_plugin.php (working copy)
  5. @@ -16,6 +16,7 @@
  6. // attribute definitions
  7. public $required_attributes = array();
  8. public $optional_attributes = array('_any');
  9. + public $shorttag_order = array('_any');
  10.  
  11. /**
  12. * Compiles code for the execution of function plugin
  13. @@ -41,18 +42,19 @@
  14. unset($_attr['nocache']);
  15. // convert attributes into parameter array string
  16. $_paramsArray = array();
  17. + $_plainParams = array();
  18. foreach ($_attr as $_key => $_value) {
  19. if (is_int($_key)) {
  20. - $_paramsArray[] = "$_key=>$_value";
  21. + $_plainParams[] = $_value;
  22. } else {
  23. $_paramsArray[] = "'$_key'=>$_value";
  24. }
  25. }
  26. $_params = 'array(' . implode(",", $_paramsArray) . ')';
  27. // compile code
  28. - $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
  29. + $output = "<?php echo {$function}(".(empty ($_plainParams) ? '' : implode (', ', $_plainParams).', ')."{$_params},\$_smarty_tpl);?>\n";
  30. return $output;
  31. }
  32. }
  33.  
  34. -?>
  35. \ No newline at end of file
  36. +?>
  37. Index: distribution/libs/sysplugins/smarty_internal_compilebase.php
  38. ===================================================================
  39. --- distribution/libs/sysplugins/smarty_internal_compilebase.php (revision 4052)
  40. +++ distribution/libs/sysplugins/smarty_internal_compilebase.php (working copy)
  41. @@ -41,6 +41,8 @@
  42. if (in_array(trim($mixed, '\'"'), $this->option_flags)) {
  43. $_indexed_attr[trim($mixed, '\'"')] = true;
  44. // shorthand attribute ?
  45. + } else if (@$this->shorttag_order[0] == '_any') {
  46. + $_indexed_attr[$key] = $mixed;
  47. } else if (isset($this->shorttag_order[$key])) {
  48. $_indexed_attr[$this->shorttag_order[$key]] = $mixed;
  49. } else {
  50. @@ -147,4 +149,4 @@
  51. }
  52. }
  53.  
  54. -?>
  55. \ No newline at end of file
  56. +?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement