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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordfenc.../lib
File: wordfenceURLHoover.php
return '%' . bin2hex($matches[0]);
[500] Fix | Delete
}
[501] Fix | Delete
[502] Fix | Delete
protected function _normalizeHost($host) {
[503] Fix | Delete
//Strip username:password
[504] Fix | Delete
$host = $this->_array_last(explode('@', $host));
[505] Fix | Delete
[506] Fix | Delete
//IPv6 literal
[507] Fix | Delete
if (substr($host, 0, 1) == '[') {
[508] Fix | Delete
if (strpos($host, ']') === false) { //No closing bracket
[509] Fix | Delete
return false;
[510] Fix | Delete
}
[511] Fix | Delete
}
[512] Fix | Delete
[513] Fix | Delete
//Strip port
[514] Fix | Delete
$host = preg_replace('/:\d+$/', '', $host);
[515] Fix | Delete
[516] Fix | Delete
//Unicode to IDNA
[517] Fix | Delete
$u = rawurldecode($host);
[518] Fix | Delete
if (preg_match('/[\x81-\xff]/', $u)) { //0x80 is technically Unicode, but the GSB canonicalization doesn't consider it one
[519] Fix | Delete
if (function_exists('idn_to_ascii')) { //Some PHP versions don't have this and we don't have a polyfill
[520] Fix | Delete
$host = idn_to_ascii($u);
[521] Fix | Delete
}
[522] Fix | Delete
}
[523] Fix | Delete
[524] Fix | Delete
//Remove extra dots
[525] Fix | Delete
$host = trim($host, '.');
[526] Fix | Delete
$host = preg_replace('/\.\.+/', '.', $host);
[527] Fix | Delete
[528] Fix | Delete
//Canonicalize IP addresses
[529] Fix | Delete
if ($iphost = $this->_parseIP($host)) {
[530] Fix | Delete
return $iphost;
[531] Fix | Delete
}
[532] Fix | Delete
[533] Fix | Delete
return strtolower($host);
[534] Fix | Delete
}
[535] Fix | Delete
[536] Fix | Delete
protected function _parseIP($host) {
[537] Fix | Delete
// The Windows resolver allows a 4-part dotted decimal IP address to have a
[538] Fix | Delete
// space followed by any old rubbish, so long as the total length of the
[539] Fix | Delete
// string doesn't get above 15 characters. So, "10.192.95.89 xy" is
[540] Fix | Delete
// resolved to 10.192.95.89. If the string length is greater than 15
[541] Fix | Delete
// characters, e.g. "10.192.95.89 xy.wildcard.example.com", it will be
[542] Fix | Delete
// resolved through DNS.
[543] Fix | Delete
if (strlen($host) <= 15) {
[544] Fix | Delete
$host = $this->_array_first(explode(' ', $host));
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
if (!preg_match('/^((?:0x[0-9a-f]+|[0-9\.])+)$/i', $host)) {
[548] Fix | Delete
return false;
[549] Fix | Delete
}
[550] Fix | Delete
[551] Fix | Delete
$parts = explode('.', $host);
[552] Fix | Delete
if (count($parts) > 4) {
[553] Fix | Delete
return false;
[554] Fix | Delete
}
[555] Fix | Delete
[556] Fix | Delete
$strings = array();
[557] Fix | Delete
foreach ($parts as $i => $p) {
[558] Fix | Delete
if ($i == count($parts) - 1) {
[559] Fix | Delete
$strings[] = $this->_canonicalNum($p, 5 - count($parts));
[560] Fix | Delete
}
[561] Fix | Delete
else {
[562] Fix | Delete
$strings[] = $this->_canonicalNum($p, 1);
[563] Fix | Delete
}
[564] Fix | Delete
[565] Fix | Delete
if ($strings[$i] == '') {
[566] Fix | Delete
return '';
[567] Fix | Delete
}
[568] Fix | Delete
}
[569] Fix | Delete
[570] Fix | Delete
return implode('.', $strings);
[571] Fix | Delete
}
[572] Fix | Delete
[573] Fix | Delete
protected function _canonicalNum($part, $n) {
[574] Fix | Delete
if ($n <= 0 || $n > 4) {
[575] Fix | Delete
return '';
[576] Fix | Delete
}
[577] Fix | Delete
[578] Fix | Delete
if (preg_match('/^0x(\d+)$/i', $part, $matches)) { //hex
[579] Fix | Delete
$part = hexdec($matches[1]);
[580] Fix | Delete
}
[581] Fix | Delete
else if (preg_match('/^0(\d+)$/i', $part, $matches)) { //octal
[582] Fix | Delete
$part = octdec($matches[1]);
[583] Fix | Delete
}
[584] Fix | Delete
else {
[585] Fix | Delete
$part = (int) $part;
[586] Fix | Delete
}
[587] Fix | Delete
[588] Fix | Delete
$strings = array_fill(0, $n, '');
[589] Fix | Delete
for ($i = $n - 1; $i >= 0; $i--) {
[590] Fix | Delete
$strings[$i] = (string) ($part & 0xff);
[591] Fix | Delete
$part = $part >> 8;
[592] Fix | Delete
}
[593] Fix | Delete
return implode('.', $strings);
[594] Fix | Delete
}
[595] Fix | Delete
[596] Fix | Delete
protected function _array_first($array) {
[597] Fix | Delete
if (empty($array)) {
[598] Fix | Delete
return null;
[599] Fix | Delete
}
[600] Fix | Delete
[601] Fix | Delete
return $array[0];
[602] Fix | Delete
}
[603] Fix | Delete
[604] Fix | Delete
protected function _array_last($array) {
[605] Fix | Delete
if (empty($array)) {
[606] Fix | Delete
return null;
[607] Fix | Delete
}
[608] Fix | Delete
[609] Fix | Delete
return $array[count($array) - 1];
[610] Fix | Delete
}
[611] Fix | Delete
}
[612] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function