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

Fix for the case when the input text is empty #888

Open
almmos opened this issue Nov 12, 2024 · 0 comments
Open

Fix for the case when the input text is empty #888

almmos opened this issue Nov 12, 2024 · 0 comments

Comments

@almmos
Copy link

almmos commented Nov 12, 2024

Hello,

I have encountered a specific edge case when the input text is empty.
This is on php 8.2 on FreeBSD 14.1

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in ./vendor/erusev/parsedown/Parsedown.php on line 43

Due to the fact that the input text is immediately used to call to protected function textElements, there will be at least a deprecated warning throw out by str_replace php function.

As a temporary workaround, I have inserted on line 26, as the first line of code in function text($text), the next one-liner snippet and moved anything else down:
if (strlen($text) == 0) return "";

Hope this will help somebody.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant