|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
rocky Smarty Regular
Joined: 08 Feb 2010 Posts: 35
|
Posted: Mon Feb 06, 2012 5:07 pm Post subject: Bugs, issue and performance |
|
|
Hi,
here are a few improvements for Smarty 3.
Maybe a developer of Smarty does this to the next update.
use the method "stream_resolve_include_path" instead of their own:
Code: |
if (function_exists('stream_resolve_include_path')) {
$_filepath = stream_resolve_include_path($_filepath);
} else {
$_filepath = Smarty_Internal_Get_Include_Path::getIncludePath($_filepath);
}
|
method templateExists from a selection extends resource always returns true?
Code: |
$r = $template->templateExists('extends:/asdf/asd.tpl');
var_dump($r);
bool(true)
|
modifier unescape is not fully developed yet:
Old:
Code: | switch (trim($params[1], '"\'')) {
case 'entity':
return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')';
case 'htmlall':
if (Smarty::$_MBSTRING) {
return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')';
}
return 'html_entity_decode(' . $params[0] . ', ENT_QUOTES, ' . $params[2] . ')';
case 'html':
return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)';
default:
return $params[0];
} |
New
Code: |
switch (trim($params[1], '"\'')) {
case 'entity':
if (Smarty::$_MBSTRING) {
return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')';
}
return 'html_entity_decode(' . $params[0] . ', ENT_NOQUOTES, ' . $params[2] . ')';
case 'htmlall':
if (Smarty::$_MBSTRING) {
return 'htmlspecialchars_decode(mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\'), ENT_QUOTES)';
}
return 'html_entity_decode(' . $params[0] . ', ENT_QUOTES, ' . $params[2] . ')';
case 'html':
return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)';
case 'url':
return 'rawurldecode(' . $params[0] . ')';
default:
return $params[0];
}
|
Heiner |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Mon Feb 06, 2012 8:33 pm Post subject: |
|
|
proposed changes have been committed to SVN and will be included in Smarty 3.1.8 _________________ Twitter |
|
Back to top |
|
rocky Smarty Regular
Joined: 08 Feb 2010 Posts: 35
|
Posted: Tue Feb 07, 2012 10:41 am Post subject: |
|
|
Hey,
that was fast.
thx
Heiner |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|