freescout-help-desk / freescout

FreeScout — Free self-hosted help desk & shared mailbox (Zendesk / Help Scout alternative)
https://freescout.net
GNU Affero General Public License v3.0
3.04k stars 497 forks source link

Deprecated str_replace at the top of all my page and website broken #2822

Closed tonitch closed 1 year ago

tonitch commented 1 year ago

image

Here as you can see there is a message on the top of the page, This message is there since the moment I finished the setup phase. I don't really know what I should do about it, I suppose it is an error on my side as I found nobody online having the same issue.

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /srv/http/freescout/overrides/vlucas/phpdotenv/src/Loader.php

also, most of the link are broken, for instance if I click on the top right on my name, there is nothing happening...

Thanks for your help!

avenjamin commented 1 year ago

Do you have any weird characters in your environment variables?

Looking at the sanitiseVariablesValue() function in Loader.php if the $value is NULL is shouldn't get to line 250, so I'm thinking somethings happening on line 249 that's causing it to be NULL

Line 249 is using a long regular expression that might be failing on one your environment variables.

Hopefully it'll be something simple like an extra single or double quote symbol.

https://github.com/freescout-helpdesk/freescout/blob/8c0afd34c1bf29d03e0009b22238bb478e4a90da/overrides/vlucas/phpdotenv/src/Loader.php#L215-L268

@freescout-helpdesk changing lines 250 and 251 to a ternary might help avoid this:

$value = str_replace("\\$quote", $quote, $value);
$value = str_replace('\\\\', '\\', $value);

to

$value = $value ? str_replace("\\$quote", $quote, $value) : "";
$value = $value ? str_replace('\\\\', '\\', $value) : "";
freescout-helpdesk commented 1 year ago

It would be good to get the full error message. Check /storage/logs/

tonitch commented 1 year ago

Well I think I kinda found the problem, I use a password Manager and used that password manager to generate a password with special characters for the admin account... and these special characters where the problem...

I don't mind sharing that password as I will change it but it's on my other computer ( I forgot to push rip )

avenjamin commented 1 year ago

@tonitch it'd be worth seeing what the special characters were that caused the issue even if you don't share the full password.

tonitch commented 1 year ago

no problem, as I said, I just created another pass here it is : <5b#xH/Rd1Ok*}(J(hZ'z/'yC

freescout-helpdesk commented 1 year ago

It's unlikely that admin password could cause this deprecation notice. Most likely something else had changed and the notice had gone. Try to find full error message in /storage/logs/

tonitch commented 1 year ago

Might be the postgresql password tho ?, I'm pretty sure it was one of them, I have made a fresh install so I can't really give you log I'm really sorry! I can give you the pass for postgres as I changed it too .. now that I changed both pass the install worked just fine

tonitch commented 1 year ago

here is the postgres password IO^m#/}^uD"(jA$k!:;/\Vk~[