($haystack) of type string is deprecated
qwerty451 opened this issue · comments
Summary
When trying to reach "/app-settings/emails" I get the error "Whoops, looks like something went wrong — check logs in /storage/logs."
Steps to reproduce
Using the latest image with php 8.2.5 and going to " /app-settings/emails"
What is the expected correct behavior?
The page loads normally.
Relevant logs and/or screenshots
[2023-05-12 09:48:22] production.ERROR: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated (View: /www/html/resources/views/settings/emails.blade.php) (View: /www/html/resources/views/settings/emails.blade.php) {"userId":2,"email":"tim@korverholland.com","exception":"[object] (ErrorException(code: 0): strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated (View: /www/html/resources/views/settings/emails.blade.php) (View: /www/html/resources/views/settings/emails.blade.php) at /data/storage/framework/views/afc08c962418014aaf4c6cb9bea7b0d488830cba.php:49, ErrorException(code: 0): strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated (View: /www/html/resources/views/settings/emails.blade.php) at /data/storage/framework/views/afc08c962418014aaf4c6cb9bea7b0d488830cba.php:49, ErrorException(code: 0): strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated at /data/storage/framework/views/afc08c962418014aaf4c6cb9bea7b0d488830cba.php:49)
Environment
- Image version / tag: 1.17.4
- Host OS: Ubuntu 22.04
Possible fixes
-
Open the affected file in a text editor:
nano /var/www/html/resources/views/settings/emails.blade.php
-
Locate the line containing
strstr()
(as per the log, it's around line 49). It should look like this:strstr(null, ...)
-
Replace the
strstr()
function with the following code to perform a null check before calling the function:(!is_null($haystack) && strstr($haystack, ...))
Replace $haystack
with the name of the variable actually used in your file and ...
with the remaining arguments passed to the strstr()
function.
Thanks for this! This seems to be a code issue and would be better suited for the https://github.com/freescout-helpdesk/freescout repository, as this handles only image issues.