Relevanssi – A Better Search - Version 4.12.1

Version Description

  • Major fix: Stops TypeError crashes from null custom field indexing.
Download this release

Release Info

Developer msaari
Plugin Icon 128x128 Relevanssi – A Better Search
Version 4.12.1
Comparing to
See all releases

Code changes from version 4.12.0 to 4.12.1

Files changed (4) hide show
  1. lib/common.php +3 -0
  2. lib/indexing.php +4 -0
  3. readme.txt +7 -1
  4. relevanssi.php +2 -2
lib/common.php CHANGED
@@ -528,6 +528,9 @@ function relevanssi_prevent_default_request( $request, $query ) {
528
  * value.
529
  */
530
  function relevanssi_tokenize( $string, $remove_stops = true, int $min_word_length = -1 ) : array {
 
 
 
531
  $string_for_phrases = is_array( $string ) ? implode( ' ', $string ) : $string;
532
  $phrases = relevanssi_extract_phrases( $string_for_phrases );
533
  $phrase_words = array();
528
  * value.
529
  */
530
  function relevanssi_tokenize( $string, $remove_stops = true, int $min_word_length = -1 ) : array {
531
+ if ( ! $string ) {
532
+ return array();
533
+ }
534
  $string_for_phrases = is_array( $string ) ? implode( ' ', $string ) : $string;
535
  $phrases = relevanssi_extract_phrases( $string_for_phrases );
536
  $phrase_words = array();
lib/indexing.php CHANGED
@@ -1268,6 +1268,10 @@ function relevanssi_index_custom_fields( &$insert_data, $post_id, $custom_fields
1268
  relevanssi_debug_echo( "\tKey: " . $field . ' - value: ' . $value );
1269
  }
1270
 
 
 
 
 
1271
  $context = 'custom_field';
1272
  $remove_stops = true;
1273
  if ( '_relevanssi_pdf_content' === $field ) {
1268
  relevanssi_debug_echo( "\tKey: " . $field . ' - value: ' . $value );
1269
  }
1270
 
1271
+ if ( ! $value ) {
1272
+ continue;
1273
+ }
1274
+
1275
  $context = 'custom_field';
1276
  $remove_stops = true;
1277
  if ( '_relevanssi_pdf_content' === $field ) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: search, relevance, better search, product search, woocommerce search
5
  Requires at least: 4.9
6
  Tested up to: 5.6.3
7
  Requires PHP: 7.0
8
- Stable tag: 4.12.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -131,6 +131,9 @@ Each document database is full of useless words. All the little words that appea
131
  * John Calahan for extensive 4.0 beta testing.
132
 
133
  == Changelog ==
 
 
 
134
  = 4.12.0 =
135
  * New feature: New filter hook `relevanssi_phrase_queries` can be used to add phrase matching queries to support more content types.
136
  * New feature: New filter hook `relevanssi_excerpt_gap` lets you adjust the first line of excerpt optimization.
@@ -208,6 +211,9 @@ Each document database is full of useless words. All the little words that appea
208
  * Minor fix: The category inclusion and exclusion setting checkboxes on the Searching tab didn't work. The setting was saved, but the checkboxes wouldn't appear.
209
 
210
  == Upgrade notice ==
 
 
 
211
  = 4.12.0 =
212
  * New features and bug fixes.
213
 
5
  Requires at least: 4.9
6
  Tested up to: 5.6.3
7
  Requires PHP: 7.0
8
+ Stable tag: 4.12.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
131
  * John Calahan for extensive 4.0 beta testing.
132
 
133
  == Changelog ==
134
+ = 4.12.1 =
135
+ * Major fix: Stops TypeError crashes from null custom field indexing.
136
+
137
  = 4.12.0 =
138
  * New feature: New filter hook `relevanssi_phrase_queries` can be used to add phrase matching queries to support more content types.
139
  * New feature: New filter hook `relevanssi_excerpt_gap` lets you adjust the first line of excerpt optimization.
211
  * Minor fix: The category inclusion and exclusion setting checkboxes on the Searching tab didn't work. The setting was saved, but the checkboxes wouldn't appear.
212
 
213
  == Upgrade notice ==
214
+ = 4.12.1 =
215
+ * Stops TypeError crashes from null custom field indexing.
216
+
217
  = 4.12.0 =
218
  * New features and bug fixes.
219
 
relevanssi.php CHANGED
@@ -13,7 +13,7 @@
13
  * Plugin Name: Relevanssi
14
  * Plugin URI: https://www.relevanssi.com/
15
  * Description: This plugin replaces WordPress search with a relevance-sorting search.
16
- * Version: 4.12.0
17
  * Author: Mikko Saari
18
  * Author URI: http://www.mikkosaari.fi/
19
  * Text Domain: relevanssi
@@ -67,7 +67,7 @@ $relevanssi_variables['database_version'] = 6;
67
  $relevanssi_variables['file'] = __FILE__;
68
  $relevanssi_variables['plugin_dir'] = plugin_dir_path( __FILE__ );
69
  $relevanssi_variables['plugin_basename'] = plugin_basename( __FILE__ );
70
- $relevanssi_variables['plugin_version'] = '4.12.0';
71
 
72
  require_once 'lib/admin-ajax.php';
73
  require_once 'lib/common.php';
13
  * Plugin Name: Relevanssi
14
  * Plugin URI: https://www.relevanssi.com/
15
  * Description: This plugin replaces WordPress search with a relevance-sorting search.
16
+ * Version: 4.12.1
17
  * Author: Mikko Saari
18
  * Author URI: http://www.mikkosaari.fi/
19
  * Text Domain: relevanssi
67
  $relevanssi_variables['file'] = __FILE__;
68
  $relevanssi_variables['plugin_dir'] = plugin_dir_path( __FILE__ );
69
  $relevanssi_variables['plugin_basename'] = plugin_basename( __FILE__ );
70
+ $relevanssi_variables['plugin_version'] = '4.12.1';
71
 
72
  require_once 'lib/admin-ajax.php';
73
  require_once 'lib/common.php';