Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Where is it stripping HTML tags??

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-12-2004, 06:53 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default 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!
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #2  
Old 07-12-2004, 08:02 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

globals.php

Code:
function func_strip_tags($var) {

__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 07-13-2004, 04:35 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

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!
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #4  
Old 07-13-2004, 06:15 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #5  
Old 07-13-2004, 06:21 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

Worked perfectly! You the man Boomer.

Thanks so much.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #6  
Old 07-15-2004, 05:37 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

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.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #7  
Old 08-30-2004, 10:37 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Thanks for this post. This was baffling me.
Reply With Quote
  #8  
Old 09-21-2004, 06:24 AM
  joshf's Avatar 
joshf joshf is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 97
 

Default 4.0.x

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


jf
__________________
joshf | X-Cart Portfolio
Currently: http://nightowlpapergoods.com | http://pinkolive.com
Reply With Quote
  #9  
Old 09-21-2004, 06:26 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

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.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:59 PM.

   

 
X-Cart forums © 2001-2020