DvdGiessen / DBSR

DBSR: Database Search & Replace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No replacement

SAMI-Bass-man opened this issue · comments

Hi,
with DBSR version 2.2.0 GUI, PHP version 8.1.5 and Mysql 8.0,
I obtain this error message at the end :
preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
and no replacement happen.

Where is the solution ?...
Thank you.

I quickly tested with the exact versions you mentioned, but was unable to reproduce your issue.

Based on the error message you shared, I'm not entirely sure what the problem is either: The function it mentions (preg_replace()) is only used in a few places so I just read throught all of them again, and the only reason I can see for this error seems to be that the MySQL database is doing something strange.

That specific function is used for operations regarding the database charset and collation, so perhaps the database contains some unusual charset/collation for some tables/columns that is causing the issue.

Some questions that might help clarify what's going wrong:

  • What kind of database are you trying to do a replacement on? I.e. is it a website database (Wordpress, Drupal, etc) or some other kind of system?
  • Does the database contain text that's mostly using a specific alphabet/writing system?
  • Which charset (the value you enter at the first page) are you using? Is that the same charset as is used with the database everywhere?

Hi Daniël,
Same error here with an MariaDB 10.5.18
The problem was solved by downgrading PHP from 8.1 to 8.0

Thanks for your work ! DBSR is very useful :)

PS : for this case, tables charset is :

  • utf8mb4_general_ci
  • utf8mb4_unicode_520_ci
  • utf8_general_ci