From: <ny...@us...> - 2008-10-10 13:27:03
|
Revision: 15077 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15077&view=rev Author: nyloth Date: 2008-10-10 13:26:52 +0000 (Fri, 10 Oct 2008) Log Message: ----------- [MOD] smarty button: handle the url arguments like 'arg=val&arg2=val2' instead of 'arg=val&arg2=val2' when using button in a template. This is to reduce risks of errors from begginners, since other links in the template must have & instead of & to be XHTML compliant. So, use this syntax for buttons as well. Modified Paths: -------------- trunk/lib/smarty_tiki/function.button.php Modified: trunk/lib/smarty_tiki/function.button.php =================================================================== --- trunk/lib/smarty_tiki/function.button.php 2008-10-10 12:38:59 UTC (rev 15076) +++ trunk/lib/smarty_tiki/function.button.php 2008-10-10 13:26:52 UTC (rev 15077) @@ -14,7 +14,7 @@ */ function smarty_function_button($params, &$smarty) { if ( ! is_array($params) || ! isset($params['_text']) ) return; - global $smarty, $prefs, $auto_query_args; + global $tikilib, $prefs, $auto_query_args; require_once $smarty->_get_plugin_filepath('block', 'self_link'); @@ -22,7 +22,7 @@ if ( ! empty($params['href']) ) { if ( ( $pos = strpos($params['href'], '?') ) !== false ) { $params['_script'] = substr($params['href'], 0, $pos); - parse_str(substr($params['href'], $pos+1), $url_args); + parse_str($tikilib->htmldecode(substr($params['href'], $pos+1)), $url_args); $params = array_merge($params, $url_args); } else { $params['_script'] = $params['href']; @@ -40,5 +40,3 @@ return '<span class="button">'.$html.'</span>'; } - -?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |