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.../views/options
File: option-ip-source.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_LS_VERSION')) { exit; }
[1] Fix | Delete
/**
[2] Fix | Delete
* Presents the global option OPTION_IP_SOURCE with a value select menu and text area (hidden by default) for trusted proxies.
[3] Fix | Delete
*/
[4] Fix | Delete
[5] Fix | Delete
$selectOptions = array(
[6] Fix | Delete
array('value' => \WordfenceLS\Model_Request::IP_SOURCE_AUTOMATIC, 'label' => esc_html__('Use the most secure method to get visitor IP addresses. Prevents spoofing and works with most sites.', 'wordfence') . ' <strong>' . esc_html__('(Recommended)', 'wordfence') . '</strong>'),
[7] Fix | Delete
array('value' => \WordfenceLS\Model_Request::IP_SOURCE_REMOTE_ADDR, 'label' => esc_html__('Use PHP\'s built in REMOTE_ADDR and don\'t use anything else. Very secure if this is compatible with your site.', 'wordfence')),
[8] Fix | Delete
array('value' => \WordfenceLS\Model_Request::IP_SOURCE_X_FORWARDED_FOR, 'label' => esc_html__('Use the X-Forwarded-For HTTP header. Only use if you have a front-end proxy or spoofing may result.', 'wordfence')),
[9] Fix | Delete
array('value' => \WordfenceLS\Model_Request::IP_SOURCE_X_REAL_IP, 'label' => esc_html__('Use the X-Real-IP HTTP header. Only use if you have a front-end proxy or spoofing may result.', 'wordfence')),
[10] Fix | Delete
);
[11] Fix | Delete
?>
[12] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-full-width">
[13] Fix | Delete
<li>
[14] Fix | Delete
<ul id="wfls-option-ip-source" class="wfls-option wfls-option-ip-source" data-option="<?php echo esc_attr(\WordfenceLS\Controller_Settings::OPTION_IP_SOURCE); ?>" data-original-value="<?php echo esc_attr(\WordfenceLS\Controller_Settings::shared()->get(\WordfenceLS\Controller_Settings::OPTION_IP_SOURCE)); ?>" data-text-area-option="<?php echo esc_attr(\WordfenceLS\Controller_Settings::OPTION_IP_TRUSTED_PROXIES); ?>" data-original-text-area-value="<?php echo esc_attr(\WordfenceLS\Controller_Settings::shared()->get(\WordfenceLS\Controller_Settings::OPTION_IP_TRUSTED_PROXIES)); ?>">
[15] Fix | Delete
<li class="wfls-option-content wfls-no-right">
[16] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-align-left">
[17] Fix | Delete
<li class="wfls-option-title"><strong><?php esc_html_e('How to get IPs', 'wordfence'); ?></strong></li>
[18] Fix | Delete
<li>
[19] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-align-left">
[20] Fix | Delete
<li class="wfls-padding-add-left">
[21] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-align-left" role="radiogroup">
[22] Fix | Delete
<?php foreach ($selectOptions as $o): ?>
[23] Fix | Delete
<li class="wfls-padding-add-top-small"><input type="radio" class="wfls-option-radio" name="wfls-ip-source" value="<?php echo esc_attr($o['value']); ?>" id="wfls-ip-source-<?php echo esc_attr(preg_replace('/[^a-z0-9]/i', '-', $o['value'])); ?>"<?php if ($o['value'] == \WordfenceLS\Controller_Settings::shared()->get(\WordfenceLS\Controller_Settings::OPTION_IP_SOURCE)) { echo ' checked'; } ?>><label for="wfls-ip-source-<?php echo esc_attr(preg_replace('/[^a-z0-9]/i', '-', $o['value'])); ?>">&nbsp;&nbsp;</label><?php echo $o['label']; ?></li>
[24] Fix | Delete
<?php endforeach; ?>
[25] Fix | Delete
</ul>
[26] Fix | Delete
</li>
[27] Fix | Delete
<li class="wfls-option-ip-source-details wfls-padding-add-top">
[28] Fix | Delete
<div class="wfls-left">Detected IP(s): <span id="wfls-ip-source-preview-all"><?php echo \WordfenceLS\Model_Request::current()->detected_ip_preview(); ?></span></div>
[29] Fix | Delete
<div class="wfls-left">Your IP with this setting: <span id="wfls-ip-source-preview-single"><?php echo esc_html(\WordfenceLS\Model_Request::current()->ip()); ?></span></div>
[30] Fix | Delete
<div class="wfls-left"><a href="#" id="wfls-ip-source-trusted-proxies-show">+ Edit trusted proxies</a></div>
[31] Fix | Delete
</li>
[32] Fix | Delete
</ul>
[33] Fix | Delete
</li>
[34] Fix | Delete
</ul>
[35] Fix | Delete
</li>
[36] Fix | Delete
</ul>
[37] Fix | Delete
</li>
[38] Fix | Delete
<li id="wfls-ip-source-trusted-proxies">
[39] Fix | Delete
<ul id="wfls-option-ip-source-trusted-proxies" class="wfls-option wfls-option-textarea" data-text-option="<?php echo esc_attr(\WordfenceLS\Controller_Settings::OPTION_IP_TRUSTED_PROXIES); ?>" data-original-text-value="<?php echo esc_attr(\WordfenceLS\Controller_Settings::shared()->get(\WordfenceLS\Controller_Settings::OPTION_IP_TRUSTED_PROXIES)); ?>">
[40] Fix | Delete
<li class="wfls-option-spacer"></li>
[41] Fix | Delete
<li class="wfls-option-content wfls-no-right">
[42] Fix | Delete
<ul>
[43] Fix | Delete
<li class="wfls-option-title">
[44] Fix | Delete
<ul class="wfls-flex-vertical wfls-flex-align-left">
[45] Fix | Delete
<li><?php esc_html_e('Trusted Proxies', 'wordfence'); ?></li>
[46] Fix | Delete
<li class="wfls-option-subtitle"><?php esc_html_e('These IPs (or CIDR ranges) will be ignored when determining the requesting IP via the X-Forwarded-For HTTP header. Enter one IP or CIDR range per line.', 'wordfence'); ?></li>
[47] Fix | Delete
</ul>
[48] Fix | Delete
</li>
[49] Fix | Delete
<li class="wfls-option-textarea">
[50] Fix | Delete
<textarea spellcheck="false" autocapitalize="none" autocomplete="off" name="howGetIPs_trusted_proxies"><?php echo esc_html(\WordfenceLS\Controller_Settings::shared()->get(\WordfenceLS\Controller_Settings::OPTION_IP_TRUSTED_PROXIES)); ?></textarea>
[51] Fix | Delete
</li>
[52] Fix | Delete
</ul>
[53] Fix | Delete
</li>
[54] Fix | Delete
</ul>
[55] Fix | Delete
</li>
[56] Fix | Delete
</ul>
[57] Fix | Delete
<script type="application/javascript">
[58] Fix | Delete
(function($) {
[59] Fix | Delete
$(function() {
[60] Fix | Delete
var updateIPPreview = function() {
[61] Fix | Delete
WFLS.updateIPPreview({ip_source: $('input[name="wfls-ip-source"]:checked').val(), ip_source_trusted_proxies: $('#wfls-ip-source-trusted-proxies textarea').val()}, function(ret) {
[62] Fix | Delete
if (ret && ret.ip) {
[63] Fix | Delete
$('#wfls-ip-source-preview-all').html(ret.preview);
[64] Fix | Delete
$('#wfls-ip-source-preview-single').html(ret.ip);
[65] Fix | Delete
}
[66] Fix | Delete
});
[67] Fix | Delete
};
[68] Fix | Delete
[69] Fix | Delete
$('input[name="wfls-ip-source"]').on('change', function() {
[70] Fix | Delete
var optionElement = $(this).closest('.wfls-option.wfls-option-ip-source');
[71] Fix | Delete
var option = optionElement.data('option');
[72] Fix | Delete
var value = $('input[name="wfls-ip-source"]:checked').val();
[73] Fix | Delete
[74] Fix | Delete
var originalValue = optionElement.data('originalValue');
[75] Fix | Delete
if (originalValue == value) {
[76] Fix | Delete
delete WFLS.pendingChanges[option];
[77] Fix | Delete
}
[78] Fix | Delete
else {
[79] Fix | Delete
WFLS.pendingChanges[option] = value;
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
WFLS.updatePendingChanges();
[83] Fix | Delete
[84] Fix | Delete
updateIPPreview();
[85] Fix | Delete
});
[86] Fix | Delete
[87] Fix | Delete
var coalescingUpdateTimer;
[88] Fix | Delete
$('#wfls-ip-source-trusted-proxies textarea').on('change paste keyup', function() {
[89] Fix | Delete
var e = this;
[90] Fix | Delete
[91] Fix | Delete
setTimeout(function() {
[92] Fix | Delete
clearTimeout(coalescingUpdateTimer);
[93] Fix | Delete
coalescingUpdateTimer = setTimeout(updateIPPreview, 1000);
[94] Fix | Delete
[95] Fix | Delete
var optionElement = $(e).closest('.wfls-option.wfls-option-textarea');
[96] Fix | Delete
var option = optionElement.data('textOption');
[97] Fix | Delete
var value = $(e).val();
[98] Fix | Delete
[99] Fix | Delete
var originalValue = optionElement.data('originalTextValue');
[100] Fix | Delete
if (originalValue == value) {
[101] Fix | Delete
delete WFLS.pendingChanges[option];
[102] Fix | Delete
}
[103] Fix | Delete
else {
[104] Fix | Delete
WFLS.pendingChanges[option] = value;
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
WFLS.updatePendingChanges();
[108] Fix | Delete
}, 4);
[109] Fix | Delete
});
[110] Fix | Delete
[111] Fix | Delete
$(window).on('wflsOptionsReset', function() {
[112] Fix | Delete
$('input[name="wfls-ip-source"]').each(function() {
[113] Fix | Delete
var optionElement = $(this).closest('.wfls-option.wfls-option-ip-source');
[114] Fix | Delete
var option = optionElement.data('option');
[115] Fix | Delete
var originalValue = optionElement.data('originalValue');
[116] Fix | Delete
[117] Fix | Delete
$(this).prop('checked', originalValue == $(this).attr('value'));
[118] Fix | Delete
});
[119] Fix | Delete
[120] Fix | Delete
$('#wfls-ip-source-trusted-proxies textarea').each(function() {
[121] Fix | Delete
var optionElement = $(this).closest('.wfls-option.wfls-option-textarea');
[122] Fix | Delete
var originalValue = optionElement.data('originalTextAreaValue');
[123] Fix | Delete
$(this).val(originalValue);
[124] Fix | Delete
});
[125] Fix | Delete
[126] Fix | Delete
updateIPPreview();
[127] Fix | Delete
});
[128] Fix | Delete
[129] Fix | Delete
$('#wfls-ip-source-trusted-proxies-show').each(function() {
[130] Fix | Delete
$(this).on('keydown', function(e) {
[131] Fix | Delete
if (e.keyCode == 32) {
[132] Fix | Delete
e.preventDefault();
[133] Fix | Delete
e.stopPropagation();
[134] Fix | Delete
[135] Fix | Delete
$(this).trigger('click');
[136] Fix | Delete
}
[137] Fix | Delete
});
[138] Fix | Delete
[139] Fix | Delete
$(this).on('click', function(e) {
[140] Fix | Delete
e.preventDefault();
[141] Fix | Delete
e.stopPropagation();
[142] Fix | Delete
[143] Fix | Delete
var isActive = $('#wfls-ip-source-trusted-proxies').hasClass('wfls-active');
[144] Fix | Delete
if (isActive) {
[145] Fix | Delete
$('#wfls-ip-source-trusted-proxies').slideUp({
[146] Fix | Delete
always: function() {
[147] Fix | Delete
$('#wfls-ip-source-trusted-proxies').removeClass('wfls-active');
[148] Fix | Delete
}
[149] Fix | Delete
});
[150] Fix | Delete
}
[151] Fix | Delete
else {
[152] Fix | Delete
$(this).parent().slideUp();
[153] Fix | Delete
$('#wfls-ip-source-trusted-proxies').slideDown({
[154] Fix | Delete
always: function() {
[155] Fix | Delete
$('#wfls-ip-source-trusted-proxies').addClass('wfls-active');
[156] Fix | Delete
}
[157] Fix | Delete
});
[158] Fix | Delete
}
[159] Fix | Delete
});
[160] Fix | Delete
});
[161] Fix | Delete
});
[162] Fix | Delete
})(jQuery);
[163] Fix | Delete
</script>
[164] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function