Logging: Prevent fatal type error when submitting empty search (#41847)
This commit is contained in:
commit
0a0351aa6a
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Prevent fatal error when submitting an empty search query on the log files screen.
|
|
@ -421,7 +421,7 @@ class FileController {
|
||||||
*/
|
*/
|
||||||
public function search_within_files( string $search, array $args = array(), array $file_args = array(), bool $count_only = false ) {
|
public function search_within_files( string $search, array $args = array(), array $file_args = array(), bool $count_only = false ) {
|
||||||
if ( '' === $search ) {
|
if ( '' === $search ) {
|
||||||
return array();
|
return $count_only ? 0 : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$search = esc_html( $search );
|
$search = esc_html( $search );
|
||||||
|
|
Loading…
Reference in New Issue