From 6c7497fc289ddc814ab026234537b220ec5acb0b Mon Sep 17 00:00:00 2001 From: "Md. Sumon Islam" Date: Tue, 28 Jun 2022 10:38:52 +0600 Subject: [PATCH 1/2] Update class-bsr-db.php Resolves #71 PHP Fatal error: Uncaught Error: Cannot access property started with '\0' in /var/www/quick2web/wp-content/plugins/better-search-replace/includes/class-bsr-db.php:344 --- includes/class-bsr-db.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/class-bsr-db.php b/includes/class-bsr-db.php index a6e8864..7541798 100644 --- a/includes/class-bsr-db.php +++ b/includes/class-bsr-db.php @@ -341,6 +341,7 @@ public function recursive_unserialize_replace( $from = '', $to = '', $data = '', $_tmp = $data; $props = get_object_vars( $data ); foreach ( $props as $key => $value ) { + $key = trim( $key ); $_tmp->$key = $this->recursive_unserialize_replace( $from, $to, $value, false, $case_insensitive ); } From eed21f273c881274bc3f07a1f21cc2a35335dfa6 Mon Sep 17 00:00:00 2001 From: "Md. Sumon Islam" Date: Tue, 3 Jan 2023 05:51:57 +0600 Subject: [PATCH 2/2] Update includes/class-bsr-db.php Co-authored-by: Jacob Dreesen --- includes/class-bsr-db.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/class-bsr-db.php b/includes/class-bsr-db.php index 7541798..7d25d0d 100644 --- a/includes/class-bsr-db.php +++ b/includes/class-bsr-db.php @@ -341,8 +341,9 @@ public function recursive_unserialize_replace( $from = '', $to = '', $data = '', $_tmp = $data; $props = get_object_vars( $data ); foreach ( $props as $key => $value ) { - $key = trim( $key ); - $_tmp->$key = $this->recursive_unserialize_replace( $from, $to, $value, false, $case_insensitive ); + if (!str_starts_with($key , "\0")) { + $_tmp->$key = $this->recursive_unserialize_replace( $from, $to, $value, false, $case_insensitive ); + } } $data = $_tmp;