WordPress.org

Ready to get started?Download WordPress

Forums

PDO (SQLite) For WordPress
Fixed a small bug in the plugin appeared under WordPress 3.0.1 (2 posts)

  1. silverknight
    Member
    Posted 3 years ago #

    Hi, I found a bug in the plugin appeared when writing a new post under WordPress version 3.0.1 .

    A warning occurs at line 117 in "wp-content/pdo/db.php".
    The problem happens, because of passing an array variable to the addslashes() function instead of a string.
    To solve the problem, the line 117 inside the escape() function that contains "return addslashes($string);" should be replaced with the following code:
    if ( !is_array($string) ){
    return addslashes($string);
    }else {
    return $string;
    }

    http://wordpress.org/extend/plugins/pdo-for-wordpress/

  2. Tim Rogers
    Member
    Posted 3 years ago #

    Hi. I experienced the same Bug.
    My Fix looks quite like yours but there is one Difference.

    function escape($string) {
    
    	if ( is_array($string) ) {
    		foreach ($string as &$value) {
    			$value = addslashes($value);
    		}
    		return $string;
    	} else {
    		return addslashes($string);
    	}
    }

    This should do what you expect the Method to do even for Arrays.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic