sruupl / batflat

Lightweight, fast and easy CMS for free. Bootstrap ready. https://batflat.org
MIT License
135 stars 53 forks source link

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

Open DarkLite25 opened 1 year ago

DarkLite25 commented 1 year ago

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 commented 1 year ago

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).