Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

mailto encode and Netscape (4.x)
Goto page Previous  1, 2
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
Galois
Smarty Rookie


Joined: 02 May 2003
Posts: 16

PostPosted: Fri May 16, 2003 11:01 pm    Post subject: this should do the trick Reply with quote

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
View user's profile Send private message Send e-mail
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Sat May 17, 2003 12:13 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Galois
Smarty Rookie


Joined: 02 May 2003
Posts: 16

PostPosted: Sat May 17, 2003 1:14 am    Post subject: wrong if statement Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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
Protected by Anti-Spam ACP