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

Two problems Deprecated: str_replace(): & 404 not found in localhost #134

Open
DarkLite25 opened this issue Oct 26, 2022 · 1 comment
Open

Comments

@DarkLite25
Copy link

DarkLite25 commented Oct 26, 2022

hello i have two problem using batflat
problem n01 after i activite Dev mode is :

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\lib\functions.php on line 278

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\lib\functions.php on line 278

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\Site.php on line 95

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\lib\functions.php on line 239

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\lib\functions.php on line 239

Deprecated: preg_replace(): Passing null to parameter #2 ($replacement) of type array|string is deprecated in C:\laragon\www\batflat\inc\modules\langswitcher\Site.php on line 75

Deprecated: preg_replace(): Passing null to parameter #2 ($replacement) of type array|string is deprecated in C:\laragon\www\batflat\inc\modules\langswitcher\Site.php on line 76

Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in C:\laragon\www\batflat\inc\core\lib\Templates.php on line 125

Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in C:\laragon\www\batflat\inc\core\lib\Templates.php on line 142

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\lib\functions.php on line 239

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\lib\functions.php on line 239

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\lib\functions.php on line 239

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\lib\functions.php on line 239

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\laragon\www\batflat\inc\core\BaseModule.php on line 74

Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in C:\laragon\www\batflat\inc\core\lib\Templates.php on line 125

Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in C:\laragon\www\batflat\inc\core\lib\Templates.php on line 142

Warning: preg_replace(): No ending delimiter '#' found in C:\laragon\www\batflat\inc\core\lib\Router.php on line 64

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in C:\laragon\www\batflat\inc\core\lib\Router.php on line 64

Deprecated: uksort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in C:\laragon\www\batflat\inc\core\lib\Router.php on line 81

and the problem n02 is i have
404 Not Found
Sorry, page does not exist.
when installing in Localhost.

@haydius
Copy link

haydius commented Jan 17, 2023

Hi @DarkLite25 !

This may be happening if you are using PHP8+ as there are several deprecated and revised functions affected since this CMS was built with PHP7.

If you're comfortable rewriting some PHP code, you could try your hand and work through the affected functions that are presenting an error. This won't cover everything that requires attention but would be a good place to start.

To assist you, here are a couple tips to help get you started:

Issue:
Deprecated: str_replace(): Passing null to parameter... and Deprecated: preg_replace(): Passing null to parameter...
Possible Fix:
Replace null with '' in each instance

Issue:
Deprecated: usort(): Returning bool... and Deprecated: uksort(): Returning bool...
Possible Fix:
Returning a bool (true/false) is no longer an option, set the response to be an integer by placing the return value inside an intval function.
Example: return intval(strlen($a[0]) < strlen($b[0]));

Otherwise, for the quick and easy fix, change the version of PHP you are using to 7.4 but please be aware that this version of PHP has reached end-of-life since 28 Nov 2022 and so would not be ideal for production systems, especially those open to the public (internet accessible).

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

2 participants