Viewing 1 replies (of 1 total)
  • The latest wordpress update has revealed this slight error in a lot of plugins. It doesnt prevent the plugin from working but a lot of website servers are configured to show errors like this on page. You can change your php.ini config to not show these errors.

    I’m no coder but seem to have solved the issue in the plugin buy changing the error on line 1017 of askapache-google-404.php from

    $results = $wpdb->get_results($wpdb->prepare($sql));

    to

    $results = $wpdb->get_results($wpdb->prepare($sql,$terms,$limit));

    On line 1014 is the database query used by line 1017

    $sql = "SELECT ID, post_title, post_content, MATCH (post_title, post_content) AGAINST ('{$terms}') AS score FROM {$wpdb->posts} WHERE MATCH (post_title, post_content) AGAINST ('{$terms}') " .
    		"AND post_type = 'post' AND post_status = 'publish' AND post_password = '' AND post_date < '" . current_time('mysql') . "' ORDER BY score DESC LIMIT {$limit}";

    $sql is a placeholder of an sql query used to get the related posts.

    $terms and $limit are placeholders used in the $sql database query

    I just added them to the $wpdb->prepare() and it seems to have worked.

    The error issue is discussed at http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

Viewing 1 replies (of 1 total)
  • The topic ‘Broken in 3.5?’ is closed to new replies.