Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../public_h.../wp-conte.../plugins/wp-super...
File: wp-cache-base.php
<?php
[0] Fix | Delete
global $WPSC_HTTP_HOST, $cache_enabled, $cache_path, $blogcacheid, $blog_cache_dir;
[1] Fix | Delete
[2] Fix | Delete
// we need to backup HTTP_HOST early in the PHP process, and if running in command line set it to something useful.
[3] Fix | Delete
if ( ! empty( $_SERVER['HTTP_HOST'] ) ) {
[4] Fix | Delete
$WPSC_HTTP_HOST = function_exists( 'mb_strtolower' ) ? mb_strtolower( $_SERVER['HTTP_HOST'] ) : strtolower( $_SERVER['HTTP_HOST'] );
[5] Fix | Delete
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
[6] Fix | Delete
$WPSC_HTTP_HOST = htmlentities( $WPSC_HTTP_HOST, ENT_COMPAT );
[7] Fix | Delete
} elseif ( PHP_SAPI === 'cli' && function_exists( 'get_option' ) ) {
[8] Fix | Delete
$WPSC_HTTP_HOST = (string) parse_url( get_option( 'home' ), PHP_URL_HOST );
[9] Fix | Delete
} else {
[10] Fix | Delete
$cache_enabled = false;
[11] Fix | Delete
$WPSC_HTTP_HOST = '';
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
// We want to be able to identify each blog in a WordPress MU install
[15] Fix | Delete
$blogcacheid = '';
[16] Fix | Delete
$blog_cache_dir = $cache_path;
[17] Fix | Delete
[18] Fix | Delete
// we might be able to simplify this. I run a multisite and the blogs directory isn't used any more.
[19] Fix | Delete
// $blogcacheid is set to the domain or prefix path of your site, and all files are put in $cache_path/supercache/$blogcacheid/[REQUEST_URI path]/
[20] Fix | Delete
if ( is_multisite() ) {
[21] Fix | Delete
global $current_blog;
[22] Fix | Delete
[23] Fix | Delete
if ( is_object( $current_blog ) && function_exists( 'is_subdomain_install' ) ) {
[24] Fix | Delete
$blogcacheid = is_subdomain_install() ? $current_blog->domain : trim( $current_blog->path, '/' );
[25] Fix | Delete
} elseif ( ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) || ( defined( 'VHOST' ) && VHOST === 'yes' ) ) {
[26] Fix | Delete
$blogcacheid = $WPSC_HTTP_HOST;
[27] Fix | Delete
} else {
[28] Fix | Delete
$request_uri = str_replace( '..', '', preg_replace( '/[ <>\'\"\r\n\t\(\)]/', '', $_SERVER['REQUEST_URI'] ) );
[29] Fix | Delete
$request_uri = str_replace( '//', '/', $request_uri );
[30] Fix | Delete
[31] Fix | Delete
$wpsc_path_segs = array_filter( explode( '/', trim( $request_uri, '/' ) ) );
[32] Fix | Delete
$wpsc_base_count = defined( 'PATH_CURRENT_SITE' ) ? count( array_filter( explode( '/', trim( PATH_CURRENT_SITE, '/' ) ) ) ) : 0;
[33] Fix | Delete
if ( ! str_ends_with( $request_uri, '/' ) ) {
[34] Fix | Delete
$wpsc_path_segs = array_slice( $wpsc_path_segs, 0, -1 );
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
if ( count( $wpsc_path_segs ) > $wpsc_base_count &&
[38] Fix | Delete
( ! defined( 'PATH_CURRENT_SITE' ) || str_starts_with( $request_uri, PATH_CURRENT_SITE ) )
[39] Fix | Delete
) {
[40] Fix | Delete
$blogcacheid = $wpsc_path_segs[ $wpsc_base_count ];
[41] Fix | Delete
}
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
// If blogcacheid is empty then set it to main blog.
[45] Fix | Delete
if ( empty( $blogcacheid ) ) {
[46] Fix | Delete
$blogcacheid = 'blog';
[47] Fix | Delete
}
[48] Fix | Delete
$blog_cache_dir = str_replace( '//', '/', $cache_path . 'blogs/' . $blogcacheid . '/' );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function