Search code examples
phpmysqlmysqlioscommerce

mysql query replaces html tags with _ underscores


I just switched an old oscommerce installation from mysql_ to mysqli_ (by changing database.php files/functions). Some SELECT statements that previously returned: <p>Bla bla <br /> blah</p> now return _p_Bla bla _br __ blah_/p_

does anyone have a quick fix, or do i need to dig deeper?


Solution

  • found it:

    old function did:

    return trim(stripslashes($string));
    

    new function includes:

    return trim(tep_sanitize_string(stripslashes($string)));

    the sanitize function included preg_replace("/[<>]/", '_', $string);