In the Bricks settings, I have the default templates turned off.
I created a template for the error page and also set the template condition to error page. This works fine, but it does generate 5 deprecation notices in the log, like this:
PHP Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxx/wp-includes/functions.php on line 1144
PHP Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxxx/wp-includes/functions.php on line 1151
PHP Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxxx/wp-includes/functions.php on line 1154
PHP Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxxx/wp-includes/functions.php on line 1161
PHP Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxxxx/wp-includes/functions.php on line 1164
This is happening in a WP core file and the functions in question look like this:
$frag = strstr( $uri, '#' );
if ( $frag ) {
$uri = substr( $uri, 0, -strlen( $frag ) );
} else {
$frag = '';
}
It fails because $uri
is empty.
I sent the contents of $uri
to the error log and refreshed the page, the log showed this when I opened a bad (404) page:
$uri = https://xxxx/wp-cron.php
$uri = https://xxxx/wp-admin/admin-ajax.php
$uri = https://xxxx/wp-includes/css/dashicons.min.css
$uri = https://xxxx/wp-includes/css/admin-bar.min.css
$uri = https://xxxx/wp-includes/css/dist/block-library/style.min.css
$uri = https://xxxx/wp-content/themes/bricks/assets/css/frontend.min.css
$uri = https://xxxx/wp-content/themes/bricks-child/style.css
$uri = https://xxxx/wp-content/themes/bricks/assets/css/frontend/404.min.css
$uri = https://xxxx/wp-content/themes/bricks/assets/css/admin.min.css
$uri = https://xxxx/wp-content/plugins/litespeed-cache/assets/css/litespeed.css
$uri = https://xxxx/wp-content/themes/bricks/assets/css/libs/animate.min.css
$uri = https://xxxx/wp-includes/js/hoverintent-js.min.js
$uri = https://xxxx/wp-includes/js/admin-bar.min.js
$uri = https://xxxx/wp-content/themes/bricks/assets/js/bricks.min.js
$uri = https://xxxx/wp-login.php?action=logout
$uri = https://xxxx/wp-login.php?action=logout
$uri = https://xxxx/wp-admin/customize.php
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=purge
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=conf
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=conf
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=conf
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=conf
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=purge
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=purge
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=purge
$uri = https://xxxx/wp-admin/admin.php?LSCWP_CTRL=purge
$uri = https://xxxx/template/404/
$uri = https://xxxx/template/header/
$uri = https://xxxx/template/footer/
$uri =
PHP Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxx/wp-includes/functions.php on line 1144
PHP Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxxx/wp-includes/functions.php on line 1151
PHP Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxxx/wp-includes/functions.php on line 1154
PHP Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxxx/wp-includes/functions.php on line 1161
PHP Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/runcloud/webapps/xxxxxxx/wp-includes/functions.php on line 1164
$uri = ?editor_mode=wordpress
$uri = https://xxxx/wp-login.php?action=logout
$uri = https://xxxx/wp-login.php?action=logout
You can see all the various URLs that load when the page is opened. At the bottom of the list you can see it loads my Bricks 404 template followed by header and footer. Then it has this one blank entry which triggers the deprecation messages.
I can’t figure out what the blank URI is supposed to be, or if it’s a Bricks thing or a WordPress thing. My guess is it’s blank because a “real” page for the 404 doesn’t actually exist in WP.
When I load some other working page, it does not trigger the notices, but I can see the output of $uri
is different:
$uri = https://xxxxx/wp-admin/admin.php?LSCWP_CTRL=purge
$uri = https://xxxxx/about-us/
$uri = https://xxxxx/template/header/
$uri = https://xxxxx/template/footer/
$uri = https://xxxxx/wp-admin/post.php?post=103&action=edit
$uri = https://xxxxx/wp-admin/post.php?post=103&action=edit&editor_mode=wordpress
$uri = https://xxxxx/wp-login.php?action=logout
$uri = https://xxxxx/wp-login.php?action=logout
Here you can see it loads the about-us page followed by header and footer, just like before it loaded 404 and then header and footer. But here, the very next URI is
uri = https://xxxxx/wp-admin/post.php?post=103&action=edit
This has a reference to a WordPress post ID 103. My 404 template doesn’t have a WP post ID, so maybe that is why it ended up with a blank entry?
How do I solve this? Do I need to create an actual page in WP?
Maybe this is nothing and WP will fix it before the deprecation notices turn into fatal errors in some future version of PHP. I happen to be on PHP 8.1 for this.
Is there anything I can do is this just the “normal” way Bricks and WP work together for pages/template like this?