|
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 |
Galois Smarty Rookie
Joined: 02 May 2003 Posts: 16
|
Posted: Fri May 16, 2003 11:01 pm Post subject: this should do the trick |
|
|
There is probably a better way to include modifier.escape,
please correct this as needed
/*
* Smarty plugin
* ------------------------------------------------------------
* Type: modifier
* Name: escape_noNN4
* Purpose: Escapes the string for all but Netscape 4 and lower
* ------------------------------------------------------------
*/
include_once(SMARTY_DIR."/plugins/modifier.escape.php");
function smarty_modifier_escape_noNN4($string, $esc_type = 'html')
{
// get the browser type and version
$browser = get_browser();
if($browser->browser != "Netscape" && $browser->version < 5) {
return smarty_modifier_escape($string, $esc_type = 'html');
} else {
return $string;
}
} |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Sat May 17, 2003 12:13 am Post subject: |
|
|
If you dont have browsecap setup right which I know alot of servers dont that wont work. _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
Galois Smarty Rookie
Joined: 02 May 2003 Posts: 16
|
Posted: Sat May 17, 2003 1:14 am Post subject: wrong if statement |
|
|
it actually needs to read like this:
if($browser->browser == "Netscape" && $browser->version < 5) {
return $string;
} else {
return smarty_modifier_escape($string, $esc_type);
}
if someone doesn't have browsecap.ini, then they can parse $_SERVER['HTTP_USER_AGENT'] to get the browser and version.
http://sourceforge.net/projects/phpsniff/ |
|
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
|