Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

str_replace null case deprecated #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ohnekopf
Copy link

Hi. i was trying to backup a database and i got a lot of deprecation warnings messing up the output:
str_replace(): Passing null to parameter #3 ($subject)
apparently some null were being passed to the function prepare_textdata? the database i was using was quite small so idk what could be causing that, and im having trouble reproducing the error now! the database was mostly empty (just one text and one term) so idk.
after backing up with this patch, and then reverting the patch and restoring the database backup, the bug was gone and i could download the backup succesfully again, no mention of str_replace.
maybe there's an easier way to avoid this by just telling php NOT to clutter the output with deprecation notices, maybe it's because i am running lwt with the "php -S" server locally isntead of with docker or a proper production server. anyway.
PHP 8.3.7
last lwt commit 8196ced (Sun Apr 21 18:08:59 2024 +0200)
cheers

@HugoFara HugoFara added the ui Any problem related to the User Interface label May 26, 2024
@HugoFara
Copy link
Owner

Hi, thanks for reaching out. I can't reproduce your issue, could you provide more details?

I have tried a backup/restore, with/without Docker, with empty/demo database, but no trouble so far, so it may come from your specific database. I may try to pinpoint the issue if you send me the old database file, or the complete stack trace.

On a general note, it is only a warning, you can safely disable them in you PHP configuration. In your PR a function supposed to receive a string receives nothing so I would not hide this bad behavior.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Any problem related to the User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants