Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #365914

    hi, I am getting this error when trying to click on the post category widget:
    Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/bouncin6/public_html/gladwave/wp-includes/wp-db.php on line 1040

    http://screencast.com/t/OMlmJwCPMD

    ps.I have WPML installed.

    please help … thank you

    #366211
    #366425

    hi, Elliott

    I tried adding the code to functions.php, but I got this error and the site became unavailable.
    Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting ‘)’ in /home/bouncin6/public_html/gladwave/wp-content/themes/enfold/functions.php on line 526

    I am not sure about the instruction,
    I added this code to functions.php,

    if(!function_exists('mysql_real_escape_string_alt')) {
    function mysql_real_escape_string_alt($value)
    {	
    	global $avia_config;
    
        $search = array("\\",  "\x00", "\n",  "\r",  "'",  '"', "\x1a");
        $replace = array("\\\\","\","\\n", "\\r", "\'", '\"', "\\Z");
    
        return str_replace($search, $replace, $value);	
    	}
    }
    

    and then I was lost, I don’t know which line to be replaced with

    $content = mysql_real_escape_string_alt($content);

    #366529

    Hey!

    Please remove the function then replace the code:

    $content = mysqli_real_escape_string($content);
    

    with this

    $content = esc_sql($content);
    

    Regards,
    Ismael

    #366771

    hi, Ismael

    I don’t think there is such line of code in my functions.php, I am using the latest enfold file.

    am I missing anything?

    #366905

    Hey!

    It should be around line 1322 in /enfold/framework/php/class-framework-widgets.php.

    $content = mysql_real_escape_string($content);
    

    Try changing it to this like Ismael suggested.

    $content = esc_sql($content);
    

    Cheers!
    Elliott

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.