diff --git a/core/modules/views/src/Plugin/views/filter/StringFilter.php b/core/modules/views/src/Plugin/views/filter/StringFilter.php index a6fb329..698b6b6 100644 --- a/core/modules/views/src/Plugin/views/filter/StringFilter.php +++ b/core/modules/views/src/Plugin/views/filter/StringFilter.php @@ -287,7 +287,7 @@ protected function opContainsWord($field) { } } - if (!$where || $where->count() == 0) { + if ($where->count() === 0) { return; } diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php index 8a89d42..e6a2ff8 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php @@ -298,7 +298,7 @@ function testFilterStringWord() { $view = Views::getView('test_view'); $view->setDisplay(); - // Change the filtering + // Change the filtering to a sting containing only illegal characters. $view->displayHandlers->get('default')->overrideOption('filters', array( 'description' => array( 'id' => 'description', @@ -329,7 +329,6 @@ function testFilterStringWord() { ), ); $this->assertIdenticalResultset($view, $resultset); - $view->destroy(); }