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/wp-conte.../plugins/wordfenc.../modules/login-se.../classes/model/text
File: javascript.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace WordfenceLS\Text;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Represents text that is already JavaScript-safe and should not be encoded again.
[5] Fix | Delete
* @package Wordfence2FA\Text
[6] Fix | Delete
*/
[7] Fix | Delete
class Model_JavaScript {
[8] Fix | Delete
private $_javaScript;
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Returns a string escaped for use in JavaScript. This is almost identical in behavior to esc_js except that
[12] Fix | Delete
* we don't call _wp_specialchars and keep \r rather than stripping it.
[13] Fix | Delete
*
[14] Fix | Delete
* @param string|Model_JavaScript $content
[15] Fix | Delete
* @return string
[16] Fix | Delete
*/
[17] Fix | Delete
public static function esc_js($content) {
[18] Fix | Delete
if (is_object($content) && ($content instanceof Model_HTML)) {
[19] Fix | Delete
return (string) $content;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
$safe_text = wp_check_invalid_utf8($content);
[23] Fix | Delete
$safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text));
[24] Fix | Delete
$safe_text = str_replace("\r", '\\r', $safe_text);
[25] Fix | Delete
$safe_text = str_replace("\n", '\\n', addslashes($safe_text));
[26] Fix | Delete
return apply_filters('js_escape', $safe_text, $content);
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
public static function echo_string_literal($string) {
[30] Fix | Delete
echo "'" . self::esc_js($string) . "'";
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
public function __construct($javaScript) {
[34] Fix | Delete
$this->_javaScript = $javaScript;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public function __toString() {
[38] Fix | Delete
return $this->_javaScript;
[39] Fix | Delete
}
[40] Fix | Delete
}
[41] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function