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.../plugins/wordfenc.../lib
File: wfView.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class wfView {
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* @var string
[5] Fix | Delete
*/
[6] Fix | Delete
protected $view_path;
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* @var string
[10] Fix | Delete
*/
[11] Fix | Delete
protected $view_file_extension = '.php';
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* @var string
[15] Fix | Delete
*/
[16] Fix | Delete
protected $view;
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* @var array
[20] Fix | Delete
*/
[21] Fix | Delete
protected $data;
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* @param string $view
[25] Fix | Delete
* @param array $data
[26] Fix | Delete
* @return wfView
[27] Fix | Delete
*/
[28] Fix | Delete
public static function create($view, $data = array()) {
[29] Fix | Delete
return new self($view, $data);
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* @param string $view
[34] Fix | Delete
* @param array $data
[35] Fix | Delete
*/
[36] Fix | Delete
public function __construct($view, $data = array()) {
[37] Fix | Delete
$this->view_path = WORDFENCE_PATH . 'views';
[38] Fix | Delete
$this->view = $view;
[39] Fix | Delete
$this->data = $data;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* @return string
[44] Fix | Delete
* @throws wfViewNotFoundException
[45] Fix | Delete
*/
[46] Fix | Delete
public function render() {
[47] Fix | Delete
$view = preg_replace('/\.{2,}/', '.', $this->view);
[48] Fix | Delete
$view_path = $this->view_path . '/' . $view . $this->view_file_extension;
[49] Fix | Delete
if (!file_exists($view_path)) {
[50] Fix | Delete
throw new wfViewNotFoundException(sprintf(/* translators: File path. */ __('The view %s does not exist or is not readable.', 'wordfence'), $view_path));
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
extract($this->data, EXTR_SKIP);
[54] Fix | Delete
[55] Fix | Delete
ob_start();
[56] Fix | Delete
/** @noinspection PhpIncludeInspection */
[57] Fix | Delete
include $view_path;
[58] Fix | Delete
return ob_get_clean();
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* @return string
[63] Fix | Delete
*/
[64] Fix | Delete
public function __toString() {
[65] Fix | Delete
try {
[66] Fix | Delete
return $this->render();
[67] Fix | Delete
} catch (wfViewNotFoundException $e) {
[68] Fix | Delete
return defined('WP_DEBUG') && WP_DEBUG ? esc_html($e->getMessage()) : esc_html__('The view could not be loaded.', 'wordfence');
[69] Fix | Delete
}
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
/**
[73] Fix | Delete
* @param $data
[74] Fix | Delete
* @return $this
[75] Fix | Delete
*/
[76] Fix | Delete
public function addData($data) {
[77] Fix | Delete
$this->data = array_merge($data, $this->data);
[78] Fix | Delete
return $this;
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
/**
[82] Fix | Delete
* @return array
[83] Fix | Delete
*/
[84] Fix | Delete
public function getData() {
[85] Fix | Delete
return $this->data;
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
/**
[89] Fix | Delete
* @param array $data
[90] Fix | Delete
* @return $this
[91] Fix | Delete
*/
[92] Fix | Delete
public function setData($data) {
[93] Fix | Delete
$this->data = $data;
[94] Fix | Delete
return $this;
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
/**
[98] Fix | Delete
* @return string
[99] Fix | Delete
*/
[100] Fix | Delete
public function getView() {
[101] Fix | Delete
return $this->view;
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
/**
[105] Fix | Delete
* @param string $view
[106] Fix | Delete
* @return $this
[107] Fix | Delete
*/
[108] Fix | Delete
public function setView($view) {
[109] Fix | Delete
$this->view = $view;
[110] Fix | Delete
return $this;
[111] Fix | Delete
}
[112] Fix | Delete
[113] Fix | Delete
/**
[114] Fix | Delete
* Prevent POP
[115] Fix | Delete
*/
[116] Fix | Delete
public function __wakeup() {
[117] Fix | Delete
$this->view_path = WORDFENCE_PATH . 'views';
[118] Fix | Delete
$this->view = null;
[119] Fix | Delete
$this->data = array();
[120] Fix | Delete
$this->view_file_extension = '.php';
[121] Fix | Delete
}
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
class wfViewNotFoundException extends Exception {
[125] Fix | Delete
}
[126] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function