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: wfCurlInterceptor.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class wfCurlInterceptionFailedException extends RuntimeException {
[2] Fix | Delete
}
[3] Fix | Delete
[4] Fix | Delete
class wfCurlInterceptor {
[5] Fix | Delete
[6] Fix | Delete
const HOOK_NAME = 'http_api_curl';
[7] Fix | Delete
[8] Fix | Delete
private $handle = null;
[9] Fix | Delete
private $options = array();
[10] Fix | Delete
private $requireInterception;
[11] Fix | Delete
[12] Fix | Delete
public function __construct($requireInterception = true) {
[13] Fix | Delete
$this->requireInterception = $requireInterception;
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
private function reset() {
[17] Fix | Delete
$this->handle = null;
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
public function setOption($option, $value) {
[21] Fix | Delete
$this->options[$option] = $value;
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
public function getHandle() {
[25] Fix | Delete
return $this->handle;
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
public function handleHook($handle) {
[29] Fix | Delete
$this->handle = $handle;
[30] Fix | Delete
curl_setopt_array($handle, $this->options);
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
public function intercept($callable) {
[34] Fix | Delete
$this->reset();
[35] Fix | Delete
$action = array($this, 'handleHook');
[36] Fix | Delete
add_action(self::HOOK_NAME, $action);
[37] Fix | Delete
$result = $callable();
[38] Fix | Delete
if ($this->handle === null && $this->requireInterception)
[39] Fix | Delete
throw new wfCurlInterceptionFailedException('Hook was not invoked with a valid cURL handle');
[40] Fix | Delete
remove_action(self::HOOK_NAME, $action);
[41] Fix | Delete
return $result;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
}
[45] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function