http://addons.oscommerce.com/info/6546
catalog/includes/functions/database.php
catalog/admin/includes/functions/database.php
Find
function tep_db_input($string, $link = 'db_link') {
global $$link;
if (function_exists('mysql_real_escape_string')) {
return mysql_real_escape_string($string, $$link);
} elseif (function_exists('mysql_escape_string')) {
return mysql_escape_string($string);
}
return addslashes($string);
}
Change to
// Added below for [TiM's osC Solutions] Safer Database Input Method: $allowable_tags = false
// To allow tags, either pass (boolean)true for all tags or example (string)'<b><i>' for certain tags.
function tep_db_input($string, $link = 'db_link', $allowable_tags = false) {
global $$link;
// BOF: [TiM's osC Solutions] Safer Database Input Method
if ($allowable_tags === false || is_string($allowable_tags)) {
$string = strip_tags($string, $allowable_tags);
}
// EOF: [TiM's osC Solutions] Safer Database Input Method
if (function_exists('mysql_real_escape_string')) {
return mysql_real_escape_string($string, $$link);
} elseif (function_exists('mysql_escape_string')) {
return mysql_escape_string($string);
}
return addslashes($string);
}
Then more info:
Quote
If you for any good reason need to store HTML code in the database, you need to
edit the tep_db_input() command like the following examples.
*** Original code (example): ***
$example_query = tep_db_query("update myTable set column='". tep_db_input($var) ."' where this='that' limit 1;");
*** To allow all tags, change to: ***
$example_query = tep_db_query("update myTable set column='". tep_db_input($var, 'db_link', true) ."' where this='that' limit 1;");
*** To allow only <b> and <i>, change to: ***
$example_query = tep_db_query("update myTable set column='". tep_db_input($var, 'db_link', '<b><i>') ."' where this='that' limit 1;");
edit the tep_db_input() command like the following examples.
*** Original code (example): ***
$example_query = tep_db_query("update myTable set column='". tep_db_input($var) ."' where this='that' limit 1;");
*** To allow all tags, change to: ***
$example_query = tep_db_query("update myTable set column='". tep_db_input($var, 'db_link', true) ."' where this='that' limit 1;");
*** To allow only <b> and <i>, change to: ***
$example_query = tep_db_query("update myTable set column='". tep_db_input($var, 'db_link', '<b><i>') ."' where this='that' limit 1;");
And yes, I need to save the HTML in my database for my links to the products manuals, the size of tables etc. that I have in the product description.
But right now I feel like a dumb blonde, Where do I actually enter this example_query















