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.../httpdocs/clone/wp-conte.../themes/Divi/core
File: wp_functions.php
<?php
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
if ( ! function_exists( '_sanitize_text_fields' ) ):
[3] Fix | Delete
/**
[4] Fix | Delete
* Internal helper function to sanitize a string from user input or from the db
[5] Fix | Delete
*
[6] Fix | Delete
* @since 4.7.0
[7] Fix | Delete
* @access private
[8] Fix | Delete
*
[9] Fix | Delete
* @param string $str String to sanitize.
[10] Fix | Delete
* @param bool $keep_newlines optional Whether to keep newlines. Default: false.
[11] Fix | Delete
* @return string Sanitized string.
[12] Fix | Delete
*/
[13] Fix | Delete
function _sanitize_text_fields( $str, $keep_newlines = false ) {
[14] Fix | Delete
$filtered = wp_check_invalid_utf8( $str );
[15] Fix | Delete
[16] Fix | Delete
if ( strpos( $filtered, '<' ) !== false ) {
[17] Fix | Delete
$filtered = wp_pre_kses_less_than( $filtered );
[18] Fix | Delete
// This will strip extra whitespace for us.
[19] Fix | Delete
$filtered = wp_strip_all_tags( $filtered, false );
[20] Fix | Delete
[21] Fix | Delete
// Use html entities in a special case to make sure no later
[22] Fix | Delete
// newline stripping stage could lead to a functional tag
[23] Fix | Delete
$filtered = str_replace( "<\n", "&lt;\n", $filtered );
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
if ( ! $keep_newlines ) {
[27] Fix | Delete
$filtered = preg_replace( '/[\r\n\t ]+/', ' ', $filtered );
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
$filtered = trim( $filtered );
[31] Fix | Delete
$found = false;
[32] Fix | Delete
[33] Fix | Delete
while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
[34] Fix | Delete
$filtered = str_replace( $match[0], '', $filtered );
[35] Fix | Delete
$found = true;
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
if ( $found ) {
[39] Fix | Delete
// Strip out the whitespace that may now exist after removing the octets.
[40] Fix | Delete
$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
return $filtered;
[44] Fix | Delete
}
[45] Fix | Delete
endif;
[46] Fix | Delete
[47] Fix | Delete
[48] Fix | Delete
if ( ! function_exists( 'get_site' ) ):
[49] Fix | Delete
/**
[50] Fix | Delete
* Retrieves site data given a site ID or site object.
[51] Fix | Delete
*
[52] Fix | Delete
* Site data will be cached and returned after being passed through a filter.
[53] Fix | Delete
* If the provided site is empty, the current site global will be used.
[54] Fix | Delete
*
[55] Fix | Delete
* @since 4.6.0
[56] Fix | Delete
*
[57] Fix | Delete
* @param WP_Site|int|null $site Optional. Site to retrieve. Default is the current site.
[58] Fix | Delete
* @return WP_Site|null The site object or null if not found.
[59] Fix | Delete
*/
[60] Fix | Delete
function get_site( $site = null ) {
[61] Fix | Delete
if ( empty( $site ) ) {
[62] Fix | Delete
$site = get_current_blog_id();
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
if ( $site instanceof WP_Site ) {
[66] Fix | Delete
$_site = $site;
[67] Fix | Delete
} elseif ( is_object( $site ) ) {
[68] Fix | Delete
$_site = new WP_Site( $site );
[69] Fix | Delete
} else {
[70] Fix | Delete
$_site = WP_Site::get_instance( $site );
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
if ( ! $_site ) {
[74] Fix | Delete
return null;
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
/**
[78] Fix | Delete
* Fires after a site is retrieved.
[79] Fix | Delete
*
[80] Fix | Delete
* @since 4.6.0
[81] Fix | Delete
*
[82] Fix | Delete
* @param WP_Site $_site Site data.
[83] Fix | Delete
*/
[84] Fix | Delete
$_site = apply_filters( 'get_site', $_site );
[85] Fix | Delete
[86] Fix | Delete
return $_site;
[87] Fix | Delete
}
[88] Fix | Delete
endif;
[89] Fix | Delete
[90] Fix | Delete
[91] Fix | Delete
if ( ! function_exists( 'sanitize_textarea_field' ) ):
[92] Fix | Delete
/**
[93] Fix | Delete
* Sanitizes a multiline string from user input or from the database.
[94] Fix | Delete
*
[95] Fix | Delete
* The function is like sanitize_text_field(), but preserves
[96] Fix | Delete
* new lines (\n) and other whitespace, which are legitimate
[97] Fix | Delete
* input in textarea elements.
[98] Fix | Delete
*
[99] Fix | Delete
* @see sanitize_text_field()
[100] Fix | Delete
*
[101] Fix | Delete
* @since 4.7.0
[102] Fix | Delete
*
[103] Fix | Delete
* @param string $str String to sanitize.
[104] Fix | Delete
* @return string Sanitized string.
[105] Fix | Delete
*/
[106] Fix | Delete
function sanitize_textarea_field( $str ) {
[107] Fix | Delete
$filtered = _sanitize_text_fields( $str, true );
[108] Fix | Delete
[109] Fix | Delete
/**
[110] Fix | Delete
* Filters a sanitized textarea field string.
[111] Fix | Delete
*
[112] Fix | Delete
* @since 4.7.0
[113] Fix | Delete
*
[114] Fix | Delete
* @param string $filtered The sanitized string.
[115] Fix | Delete
* @param string $str The string prior to being sanitized.
[116] Fix | Delete
*/
[117] Fix | Delete
return apply_filters( 'sanitize_textarea_field', $filtered, $str );
[118] Fix | Delete
}
[119] Fix | Delete
endif;
[120] Fix | Delete
[121] Fix | Delete
[122] Fix | Delete
if ( ! function_exists( 'wp_doing_ajax' ) ):
[123] Fix | Delete
function wp_doing_ajax() {
[124] Fix | Delete
/**
[125] Fix | Delete
* Filters whether the current request is an Ajax request.
[126] Fix | Delete
*
[127] Fix | Delete
* @since 4.7.0
[128] Fix | Delete
*
[129] Fix | Delete
* @param bool $wp_doing_ajax Whether the current request is an Ajax request.
[130] Fix | Delete
*/
[131] Fix | Delete
return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
[132] Fix | Delete
}
[133] Fix | Delete
endif;
[134] Fix | Delete
[135] Fix | Delete
[136] Fix | Delete
if ( ! function_exists( 'wp_doing_cron' ) ):
[137] Fix | Delete
function wp_doing_cron() {
[138] Fix | Delete
/**
[139] Fix | Delete
* Filters whether the current request is a WordPress cron request.
[140] Fix | Delete
*
[141] Fix | Delete
* @since 4.8.0
[142] Fix | Delete
*
[143] Fix | Delete
* @param bool $wp_doing_cron Whether the current request is a WordPress cron request.
[144] Fix | Delete
*/
[145] Fix | Delete
return apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON );
[146] Fix | Delete
}
[147] Fix | Delete
endif;
[148] Fix | Delete
[149] Fix | Delete
if ( ! function_exists( 'has_block' ) ):
[150] Fix | Delete
/**
[151] Fix | Delete
* Placeholder for real WP function that exists when GB is installed, i.e. WP >= 5.0
[152] Fix | Delete
* It would determine whether a $post or a string contains a specific block type.
[153] Fix | Delete
*
[154] Fix | Delete
* @see has_block()
[155] Fix | Delete
*
[156] Fix | Delete
* @since 4.2
[157] Fix | Delete
*
[158] Fix | Delete
* @return bool forced false result.
[159] Fix | Delete
*/
[160] Fix | Delete
function has_block() {
[161] Fix | Delete
return false;
[162] Fix | Delete
}
[163] Fix | Delete
endif;
[164] Fix | Delete
[165] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function