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.../views/waf
File: option-whitelist.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_VERSION')) { exit; }
[1] Fix | Delete
?>
[2] Fix | Delete
<ul id="wf-option-wafWhitelist" class="wf-option wf-flex-vertical wf-flex-full-width">
[3] Fix | Delete
<li><strong><?php esc_html_e('Add Allowlisted URL/Param', 'wordfence'); ?></strong> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_WAF_WHITELIST); ?>" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a> <?php esc_html_e('The URL/parameters in this table will not be tested by the firewall. They are typically added while the firewall is in Learning Mode or by an admin who identifies a particular action/request is a false positive.', 'wordfence'); ?></li>
[4] Fix | Delete
<li id="whitelist-form">
[5] Fix | Delete
<div class="wf-form-inline">
[6] Fix | Delete
<div class="wf-form-group">
[7] Fix | Delete
<input class="wf-form-control" type="text" name="whitelistURL" id="whitelistURL" placeholder="<?php esc_attr_e('URL', 'wordfence'); ?>">
[8] Fix | Delete
</div>
[9] Fix | Delete
<div class="wf-form-group">
[10] Fix | Delete
<select class="wf-form-control" name="whitelistParam" id="whitelistParam">
[11] Fix | Delete
<option value="request.body"><?php esc_html_e('POST Body', 'wordfence'); ?></option>
[12] Fix | Delete
<option value="request.cookies"><?php esc_html_e('Cookie', 'wordfence'); ?></option>
[13] Fix | Delete
<option value="request.fileNames"><?php esc_html_e('File Name', 'wordfence'); ?></option>
[14] Fix | Delete
<option value="request.headers"><?php esc_html_e('Header', 'wordfence'); ?></option>
[15] Fix | Delete
<option value="request.queryString"><?php esc_html_e('Query String', 'wordfence'); ?></option>
[16] Fix | Delete
</select>
[17] Fix | Delete
</div>
[18] Fix | Delete
<div class="wf-form-group">
[19] Fix | Delete
<input class="wf-form-control" type="text" name="whitelistParamName" id="whitelistParamName" placeholder="<?php esc_attr_e('Param Name', 'wordfence'); ?>">
[20] Fix | Delete
</div>
[21] Fix | Delete
<a href="#" class="wf-btn wf-btn-callout wf-btn-primary wf-disabled" id="waf-whitelisted-urls-add" role="button"><?php esc_html_e('Add', 'wordfence'); ?></a>
[22] Fix | Delete
</div>
[23] Fix | Delete
<script type="application/javascript">
[24] Fix | Delete
(function($) {
[25] Fix | Delete
$(function() {
[26] Fix | Delete
$('#whitelistURL, #whitelistParamName').on('change paste keyup', function() {
[27] Fix | Delete
setTimeout(function() {
[28] Fix | Delete
$('#waf-whitelisted-urls-add').toggleClass('wf-disabled', $('#whitelistURL').val().length == 0 || $('#whitelistParamName').val().length == 0);
[29] Fix | Delete
}, 100);
[30] Fix | Delete
});
[31] Fix | Delete
[32] Fix | Delete
$('#waf-whitelisted-urls-add').on('click', function(e) {
[33] Fix | Delete
e.preventDefault();
[34] Fix | Delete
e.stopPropagation();
[35] Fix | Delete
[36] Fix | Delete
var form = $('#whitelist-form');
[37] Fix | Delete
var inputURL = form.find('[name=whitelistURL]');
[38] Fix | Delete
var inputParam = form.find('[name=whitelistParam]');
[39] Fix | Delete
var inputParamName = form.find('[name=whitelistParamName]');
[40] Fix | Delete
[41] Fix | Delete
var url = inputURL.val();
[42] Fix | Delete
var param = inputParam.val();
[43] Fix | Delete
var paramName = inputParamName.val();
[44] Fix | Delete
if (url && param) {
[45] Fix | Delete
<?php $user = wp_get_current_user(); ?>
[46] Fix | Delete
var paramKey = WFAD.base64_encode(param + '[' + paramName + ']');
[47] Fix | Delete
var pathKey = WFAD.base64_encode(url);
[48] Fix | Delete
var key = pathKey + '|' + paramKey;
[49] Fix | Delete
var matches = $('#waf-whitelisted-urls-wrapper .whitelist-table > tbody > tr[data-key="' + key + '"]');
[50] Fix | Delete
if (matches.length > 0) {
[51] Fix | Delete
WFAD.colorboxModal((WFAD.isSmallScreen ? '300px' : '400px'), '<?php esc_attr_e('Allowlist Entry Exists', 'wordfence'); ?>', '<?php esc_attr_e('An allowlist entry for this URL and parameter already exists.', 'wordfence'); ?>');
[52] Fix | Delete
return;
[53] Fix | Delete
}
[54] Fix | Delete
[55] Fix | Delete
//Generate entry and add to display data set
[56] Fix | Delete
var entry = {
[57] Fix | Delete
data: {
[58] Fix | Delete
description: "<?php esc_attr_e('Allowlisted via Firewall Options page', 'wordfence'); ?>",
[59] Fix | Delete
source: 'waf-options',
[60] Fix | Delete
disabled: false,
[61] Fix | Delete
ip: "<?php echo esc_attr(wfUtils::getIP()); ?>",
[62] Fix | Delete
timestamp: Math.round(Date.now() / 1000),
[63] Fix | Delete
userID: <?php echo (int) $user->ID; ?>,
[64] Fix | Delete
username: "<?php echo esc_attr($user->user_login); ?>"
[65] Fix | Delete
},
[66] Fix | Delete
paramKey: paramKey,
[67] Fix | Delete
path: pathKey,
[68] Fix | Delete
ruleID: ['all'],
[69] Fix | Delete
adding: true
[70] Fix | Delete
};
[71] Fix | Delete
WFAD.wafData.whitelistedURLParams.push(entry);
[72] Fix | Delete
[73] Fix | Delete
//Add to change list
[74] Fix | Delete
if (!(WFAD.pendingChanges['whitelistedURLParams'] instanceof Object)) {
[75] Fix | Delete
WFAD.pendingChanges['whitelistedURLParams'] = {};
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
if (!(WFAD.pendingChanges['whitelistedURLParams']['add'] instanceof Object)) {
[79] Fix | Delete
WFAD.pendingChanges['whitelistedURLParams']['add'] = {};
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
WFAD.pendingChanges['whitelistedURLParams']['add'][key] = entry;
[83] Fix | Delete
WFAD.updatePendingChanges();
[84] Fix | Delete
[85] Fix | Delete
//Reload and reset add form
[86] Fix | Delete
var whitelistedIPsEl = $('#waf-whitelisted-urls-tmpl').tmpl(WFAD.wafData);
[87] Fix | Delete
$('#waf-whitelisted-urls-wrapper').html(whitelistedIPsEl);
[88] Fix | Delete
$(window).trigger('wordfenceWAFInstallWhitelistEventHandlers');
[89] Fix | Delete
[90] Fix | Delete
inputURL.val('');
[91] Fix | Delete
inputParamName.val('');
[92] Fix | Delete
}
[93] Fix | Delete
});
[94] Fix | Delete
});
[95] Fix | Delete
})(jQuery);
[96] Fix | Delete
</script>
[97] Fix | Delete
</li>
[98] Fix | Delete
<li><hr id="whitelist-form-separator"></li>
[99] Fix | Delete
<li id="whitelist-table-controls" class="wf-flex-horizontal wf-flex-vertical-xs wf-flex-full-width">
[100] Fix | Delete
<div><a href="#" id="whitelist-bulk-delete" class="wf-btn wf-btn-callout wf-btn-default" role="button"><?php esc_html_e('Delete', 'wordfence'); ?></a>&nbsp;&nbsp;<a href="#" id="whitelist-bulk-enable" class="wf-btn wf-btn-callout wf-btn-default" role="button"><?php esc_html_e('Enable', 'wordfence'); ?></a>&nbsp;&nbsp;<a href="#" id="whitelist-bulk-disable" class="wf-btn wf-btn-callout wf-btn-default" role="button"><?php esc_html_e('Disable', 'wordfence'); ?></a></div>
[101] Fix | Delete
<div class="wf-right wf-left-xs wf-padding-add-top-xs-small">
[102] Fix | Delete
<div class="wf-select-group wf-flex-vertical-xs wf-flex-full-width">
[103] Fix | Delete
<select name="filterColumn">
[104] Fix | Delete
<option value="url"><?php esc_html_e('URL', 'wordfence'); ?></option>
[105] Fix | Delete
<option value="param"><?php esc_html_e('Param', 'wordfence'); ?></option>
[106] Fix | Delete
<option value="source"><?php esc_html_e('Source', 'wordfence'); ?></option>
[107] Fix | Delete
<option value="user"><?php esc_html_e('User', 'wordfence'); ?></option>
[108] Fix | Delete
<option value="ip"><?php esc_html_e('IP', 'wordfence'); ?></option>
[109] Fix | Delete
</select>
[110] Fix | Delete
<input type="text" class="wf-form-control" placeholder="<?php esc_attr_e('Filter Value', 'wordfence'); ?>" name="filterValue">
[111] Fix | Delete
<div><span class="wf-hidden-xs">&nbsp;&nbsp;</span><a href="#" id="whitelist-apply-filter" class="wf-btn wf-btn-callout wf-btn-default" role="button"><?php esc_html_e('Filter', 'wordfence'); ?></a></div>
[112] Fix | Delete
</div>
[113] Fix | Delete
<script type="application/javascript">
[114] Fix | Delete
(function($) {
[115] Fix | Delete
$(function() {
[116] Fix | Delete
$('#whitelist-apply-filter').on('click', function(e) {
[117] Fix | Delete
e.preventDefault();
[118] Fix | Delete
e.stopPropagation();
[119] Fix | Delete
[120] Fix | Delete
$(window).trigger('wordfenceWAFApplyWhitelistFilter');
[121] Fix | Delete
});
[122] Fix | Delete
});
[123] Fix | Delete
})(jQuery);
[124] Fix | Delete
</script>
[125] Fix | Delete
</div>
[126] Fix | Delete
</li>
[127] Fix | Delete
<li>
[128] Fix | Delete
<div id="waf-whitelisted-urls-wrapper"></div>
[129] Fix | Delete
</li>
[130] Fix | Delete
</ul>
[131] Fix | Delete
<script type="application/javascript">
[132] Fix | Delete
(function($) {
[133] Fix | Delete
$(function() {
[134] Fix | Delete
$('#whitelistParam').wfselect2({
[135] Fix | Delete
minimumResultsForSearch: -1,
[136] Fix | Delete
templateSelection: function(item) {
[137] Fix | Delete
return 'Param Type: ' + item.text;
[138] Fix | Delete
}
[139] Fix | Delete
});
[140] Fix | Delete
[141] Fix | Delete
$('#whitelist-table-controls select').wfselect2({
[142] Fix | Delete
minimumResultsForSearch: -1,
[143] Fix | Delete
placeholder: "Filter By",
[144] Fix | Delete
width: '200px',
[145] Fix | Delete
templateSelection: function(item) {
[146] Fix | Delete
return 'Filter By: ' + item.text;
[147] Fix | Delete
}
[148] Fix | Delete
});
[149] Fix | Delete
[150] Fix | Delete
$('#whitelist-bulk-delete').on('click', function(e) {
[151] Fix | Delete
e.preventDefault();
[152] Fix | Delete
e.stopPropagation();
[153] Fix | Delete
[154] Fix | Delete
WFAD.wafWhitelistedBulkDelete();
[155] Fix | Delete
WFAD.updatePendingChanges();
[156] Fix | Delete
var whitelistedIPsEl = $('#waf-whitelisted-urls-tmpl').tmpl(WFAD.wafData);
[157] Fix | Delete
$('#waf-whitelisted-urls-wrapper').html(whitelistedIPsEl);
[158] Fix | Delete
$(window).trigger('wordfenceWAFInstallWhitelistEventHandlers');
[159] Fix | Delete
});
[160] Fix | Delete
[161] Fix | Delete
$('#whitelist-bulk-enable').on('click', function(e) {
[162] Fix | Delete
e.preventDefault();
[163] Fix | Delete
e.stopPropagation();
[164] Fix | Delete
[165] Fix | Delete
WFAD.wafWhitelistedBulkChangeEnabled(true);
[166] Fix | Delete
WFAD.updatePendingChanges();
[167] Fix | Delete
});
[168] Fix | Delete
[169] Fix | Delete
$('#whitelist-bulk-disable').on('click', function(e) {
[170] Fix | Delete
e.preventDefault();
[171] Fix | Delete
e.stopPropagation();
[172] Fix | Delete
[173] Fix | Delete
WFAD.wafWhitelistedBulkChangeEnabled(false);
[174] Fix | Delete
WFAD.updatePendingChanges();
[175] Fix | Delete
});
[176] Fix | Delete
});
[177] Fix | Delete
})(jQuery);
[178] Fix | Delete
</script>
[179] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function