• Hi there,

    current version of plugin (8.1.4) has some error (and I’m not sure, how to fix it – don’t know, what was ment by affected function) causing to create invalid sql query in function se_search_pages() when “$this->options[‘se_approved_pages_only’]” is true:

    ( wp_58_posts.post_type = 'page' AND 'post_password = '' AND ((wp_58_posts.post_status = 'publish'))

    my quick fix (syntax OK, not sure of correct “business” functionality):
    $where = str_replace( "post_type = 'post'", "post_type = 'page' AND post_password = '' ", $where );

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'publish'))) AND post_type != 'revision') AND post_status != 'future'  ORDER BY w' at line 1 pre požiadavku SELECT DISTINCT   wp_58_posts.* FROM wp_58_posts  LEFT JOIN wp_58_term_relationships AS trel ON (wp_58_posts.ID = trel.object_id) LEFT JOIN wp_58_term_taxonomy AS ttax ON (  ( ttax.taxonomy = 'category' OR ttax.taxonomy = 'post_tag' OR ttax.taxonomy = 'post_format' )  AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_58_terms AS tter ON (ttax.term_id = tter.term_id)  LEFT JOIN wp_58_comments AS cmt ON ( cmt.comment_post_ID = wp_58_posts.ID )  LEFT JOIN wp_58_postmeta AS m ON (wp_58_posts.ID = m.post_id)  LEFT JOIN wp_users AS u ON (wp_58_posts.post_author = u.ID)  WHERE 1=1 AND ( ( wp_58_posts.post_type = 'page' AND 'post_password = ''  AND ((wp_58_posts.post_status = 'publish'))) AND post_type != 'revision') AND post_status != 'future'  ORDER BY wp_58_posts.post_date DESC LIMIT 0, 5

    https://wordpress.org/plugins/search-everything/

The topic ‘invalid sql query’ is closed to new replies.