X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Where is it stripping HTML tags?? (https://forum.x-cart.com/showthread.php?t=8416)

jeremye 07-12-2004 06:53 AM

Where is it stripping HTML tags??
 
When I change the value of the Languages, for example changing "txt_welcome" to include the text "Welcome!" it strips out the HTML tags and only inserts "Welcome!" into the DB. I looked all over the code and can't find where it it stripping the tags. Please help!!

Thanks!

B00MER 07-12-2004 08:02 PM

globals.php

Code:

function func_strip_tags($var) {

;)

jeremye 07-13-2004 04:35 AM

Thanks Boomer! It looks as if the func_strip_tags function is used all over the place, not just for editing language variables. So how could I manually disable the tag stripping JUST for editing language variables. I did a "grep -r 'func_strip_tags' *" in the root of the /xcart directory and it only found matches in globals.php, nothing else. That doesn't make sense to me. I couldn't find any references to this in languages.php. Any suggestions?

Thanks!

B00MER 07-13-2004 06:15 AM

Just comment out line:
Code:

$HTTP_POST_VARS[$__var] = func_strip_tags($__res);

As globals.php is included in every file. All post data is stripped of html.

jeremye 07-13-2004 06:21 AM

Worked perfectly! You the man Boomer.

Thanks so much.

jeremye 07-15-2004 05:37 AM

Just as a follow up, I found that the safe way to do this is to leave globals.php alone and at the top of languages.php, it should be:

Code:

define('USE_TRUSTED_POST_VARIABLES',1);
$trusted_post_variables = array("var_value", "new_var_value");

require "../smarty.php";
require "../config.php";
require "./auth.php";


This authorizes var_value and new_var_value as trusted post variables and will not strip the HTML tags.

Jon 08-30-2004 10:37 PM

Thanks for this post. This was baffling me.

joshf 09-21-2004 06:24 AM

4.0.x
 
Where is $trusted_post_variables defined in 4.0.x? I seem to be missing it.. ;)


jf

jeremye 09-21-2004 06:26 AM

They probably drastically changed the way they handle trusted vars, just a guess. I am still on 3.4.x stable branch, so I can't help you here. Sorry.


All times are GMT -8. The time now is 12:26 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.