Support » Plugin: Relevanssi - A Better Search » [Bug fix] for when Relevanssi has not been translated to language x

  • jrf

    (@jrf)


    Hi Mikko,

    Here’s another small fix:

    File /lib/stopwords.php, line 14-21:

    include($relevanssi_variables['plugin_dir'] . 'stopwords/stopwords.' . $lang);
    
    	if (is_array($stopwords) && count($stopwords) > 0) {
    		foreach ($stopwords as $word) {
    			$q = $wpdb->prepare("INSERT IGNORE INTO " . $relevanssi_variables['stopword_table'] . " (stopword) VALUES (%s)", trim($word));
    			$wpdb->query($q);
    		}
    	}

    Replace with:

    if( file_exists( $relevanssi_variables['plugin_dir'] . 'stopwords/stopwords.' . $lang ) {
    		include($relevanssi_variables['plugin_dir'] . 'stopwords/stopwords.' . $lang);
    
    		if (is_array($stopwords) && count($stopwords) > 0) {
    			foreach ($stopwords as $word) {
    				$q = $wpdb->prepare("INSERT IGNORE INTO " . $relevanssi_variables['stopword_table'] . " (stopword) VALUES (%s)", trim($word));
    				$wpdb->query($q);
    			}
    		}
    	}

    Hope this helps & keep up the good work 😉

    Smile,
    Juliette

    http://wordpress.org/plugins/relevanssi/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Bug fix] for when Relevanssi has not been translated to language x’ is closed to new replies.