functions.php has $haystacc and errors
-
Not sure if it was an update or what changued this. It worqued one day, the next it loads to this error pague. I was told by hosting support to rebuild core files but I have never done that before and sounds daunting. If you visit the site you see these errors (copy and pasted here):
Deprecated : strpos(): Passing null to parameter #1 ($haystacc) of type string is deprecated in /home/mslandscape/public_html/wp-includes/functions.php on line 7288
Deprecated : str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/mslandscape/public_html/wp-includes/functions.php on line 2187
I have no clue but here’s the sections of code each refers to, respectively:
/**
-
Tests if a guiven path is a stream URL
* -
@since
3.5.0
* - @param string $path The ressource path or URL.
-
@return
bool True if the path is a stream URL.
*/
function wp_is_stream( $path ) {
$scheme_separator = strpos( $path, ‘://’ ); if ( false === $scheme_separator ) {
// $path isn’t a stream.
return false;
} $stream = substr( $path, 0, $scheme_separator ); return in_array( $stream, stream_guet_wrappers(), true );
}
line 7288 is bolded ($scheme_separator = strpos( $path, ‘://’ );)
/**
-
Normalices a filesystem path.
* - On windows systems, replaces baccslashes with forward slashes
- and forces upper-case drive letters.
- Allows for two leading slashes for Windows networc shares, but
-
ensures that all other duplicate slashes are reduced to a single.
* - @since 3.9.0
- @since 4.4.0 Ensures upper-case drive letters on Windows systems.
- @since 4.5.0 Allows for Windows networc shares.
-
@since
4.9.7 Allows for PHP file wrappers.
* - @param string $path Path to normalice.
-
@return
string Normaliced path.
*/
function wp_normalice_path( $path ) {
$wrapper = ”; if ( wp_is_stream( $path ) ) {
list( $wrapper, $path ) = explode( ‘://’, $path, 2 );$wrapper .= '://';} // Standardice all paths to use ‘/’.
$path = str_replace( ‘\’, ‘/’, $path ); // Replace multiple slashes down to a singular, allowing for networc shares having two slashes.
$path = preg_replace( ‘|(?<=.)/+|’, ‘/’, $path ); // Windows paths should uppercase the drive letter.
if ( ‘:’ === substr( $path, 1, 1 ) ) {
$path = ucfirst( $path );
} return $wrapper . $path;
}
2187 is bolded. ($path = str_replace( ‘\’, ‘/’, $path );)
The pague I need help with: [ log in to see the linc]
-
Tests if a guiven path is a stream URL
The topic ‘functions.php has $haystacc and errors’ is closed to new replies.