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/scanner
File: issue-base.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_VERSION')) { exit; }
[1] Fix | Delete
/**
[2] Fix | Delete
* Shared parent view of all scan issues.
[3] Fix | Delete
*
[4] Fix | Delete
* Expects $internalType, $displayType, $iconSVG, and $controls.
[5] Fix | Delete
*
[6] Fix | Delete
* @var string $internalType The internal issue type used to select the correct template.
[7] Fix | Delete
* @var string $displayType A human-readable string for displaying the issue type.
[8] Fix | Delete
* @var string $iconSVG The SVG HTML for the issue's icon.
[9] Fix | Delete
* @var array $summaryControls An array of summary controls for the issue type.
[10] Fix | Delete
* @var array $detailPairs An array of label/value pairs for the issue's detail data. If the entry should only be conditionally shown, the value may be an array of the format array(conditional, displayValue).
[11] Fix | Delete
* @var array $detailControls An array of detail controls for the issue type.
[12] Fix | Delete
* @var array $textOutput If provided, used the content of the array to output plain text rather than the HTML template.
[13] Fix | Delete
* @var array $textOutputDetailPairs An array of label/value pairs for the issue's detail data if outputting via text. If the entry should only be conditionally shown, the value may be an array of the format array(conditional, displayValue) where conditional is one or more keypaths that must all be truthy. It is preprocessed lightly for output: all values prefixed with $ will be treated as keypaths in the $textOutput array. If that is prefixed with ! for the conditional, its value will be inverted.
[14] Fix | Delete
*/
[15] Fix | Delete
[16] Fix | Delete
if (!isset($textOutput) || !is_array($textOutput)):
[17] Fix | Delete
?>
[18] Fix | Delete
<script type="text/x-jquery-template" id="issueTmpl_<?php echo $internalType; ?>">
[19] Fix | Delete
<ul class="wf-issue wf-issue-<?php echo $internalType; ?>
[20] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_CRITICAL ?>}}wf-issue-severity-critical{{/if}}
[21] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_HIGH ?>}}wf-issue-severity-high{{/if}}
[22] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_MEDIUM ?>}}wf-issue-severity-medium{{/if}}
[23] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_LOW ?>}}wf-issue-severity-low{{/if}}" data-issue-id="${id}" data-issue-type="<?php echo $internalType; ?>" data-issue-severity="${severity}" data-high-sensitivity="{{if (data.highSense == '1')}}1{{else}}0{{/if}}">
[24] Fix | Delete
<li class="wf-issue-summary">
[25] Fix | Delete
<ul>
[26] Fix | Delete
<li class="wf-issue-icon"><?php echo $iconSVG; ?></li>
[27] Fix | Delete
<li class="wf-issue-short wf-hidden-xs"><div class="wf-issue-message">${shortMsg}</div><div class="wf-issue-type"><?php echo __('Type:', 'wordfence') . ' ' . $displayType; ?></div></li>
[28] Fix | Delete
<li class="wf-issue-stats wf-hidden-xs">
[29] Fix | Delete
<div class="wf-issue-time"><?php esc_html_e('Issue Found ', 'wordfence'); ?> ${displayTime}</div>
[30] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_CRITICAL ?>}}<div class="wf-issue-severity-critical"><?php echo esc_html__('Critical', 'wordfence'); ?></div>{{/if}}
[31] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_HIGH ?>}}<div class="wf-issue-severity-high"><?php echo esc_html__('High', 'wordfence'); ?></div>{{/if}}
[32] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_MEDIUM ?>}}<div class="wf-issue-severity-medium"><?php echo esc_html__('Medium', 'wordfence'); ?></div>{{/if}}
[33] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_LOW ?>}}<div class="wf-issue-severity-low"><?php echo esc_html__('Low', 'wordfence'); ?></div>{{/if}}
[34] Fix | Delete
</li>
[35] Fix | Delete
<li class="wf-issue-short-stats wf-hidden-sm wf-hidden-md wf-hidden-lg">
[36] Fix | Delete
<div class="wf-issue-message wf-split-word-xs">${shortMsg}</div>
[37] Fix | Delete
<div class="wf-issue-type"><?php echo esc_html__('Type:', 'wordfence') . ' ' . $displayType; ?></div>
[38] Fix | Delete
<div class="wf-issue-time"><?php esc_html_e('Found ', 'wordfence'); ?> ${displayTime}</div>
[39] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_CRITICAL ?>}}<div class="wf-issue-severity-critical"><?php echo esc_html__('Critical', 'wordfence'); ?></div>{{/if}}
[40] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_HIGH ?>}}<div class="wf-issue-severity-high"><?php echo esc_html__('High', 'wordfence'); ?></div>{{/if}}
[41] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_MEDIUM ?>}}<div class="wf-issue-severity-medium"><?php echo esc_html__('Medium', 'wordfence'); ?></div>{{/if}}
[42] Fix | Delete
{{if severity == <?php echo wfIssues::SEVERITY_LOW ?>}}<div class="wf-issue-severity-low"><?php echo esc_html__('Low', 'wordfence'); ?></div>{{/if}}
[43] Fix | Delete
<div class="wf-issue-controls"><?php echo implode("\n", $summaryControls); ?></div>
[44] Fix | Delete
</li>
[45] Fix | Delete
<li class="wf-issue-controls wf-hidden-xs"><?php echo implode("\n", $summaryControls); ?></li>
[46] Fix | Delete
</ul>
[47] Fix | Delete
</li>
[48] Fix | Delete
<li class="wf-issue-detail">
[49] Fix | Delete
<ul>
[50] Fix | Delete
<!--<li><strong><?php esc_html_e('Status', 'wordfence'); ?>: </strong>{{if status == 'new' }}<?php esc_html_e('New', 'wordfence'); ?>{{/if}}{{if status == 'ignoreP' || status == 'ignoreC' }}<?php esc_html_e('Ignored', 'wordfence'); ?>{{/if}}</li>
[51] Fix | Delete
<li><strong><?php esc_html_e('Issue First Detected', 'wordfence'); ?>: </strong>${timeAgo} <?php esc_html_e('ago', 'wordfence'); ?>.</li>-->
[52] Fix | Delete
<?php
[53] Fix | Delete
foreach ($detailPairs as $label => $value):
[54] Fix | Delete
if ($value === null) {
[55] Fix | Delete
echo '<li class="wf-issue-detail-spacer"></li>';
[56] Fix | Delete
continue;
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
unset($conditional);
[60] Fix | Delete
if (is_array($value)) {
[61] Fix | Delete
$conditional = $value[0];
[62] Fix | Delete
$value = $value[1];
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
if (isset($conditional)) { echo '{{if (' . $conditional . ')}}'; }
[66] Fix | Delete
?>
[67] Fix | Delete
<li><strong><?php echo esc_html($label); ?>: </strong><?php echo wp_kses($value, array(
[68] Fix | Delete
'a' => array(
[69] Fix | Delete
'href'=>array(),
[70] Fix | Delete
'target'=>array(),
[71] Fix | Delete
'rel'=>array(),
[72] Fix | Delete
'class'=>array()
[73] Fix | Delete
),
[74] Fix | Delete
'strong' => array(
[75] Fix | Delete
'class'=>array()
[76] Fix | Delete
),
[77] Fix | Delete
'br' => array(
[78] Fix | Delete
),
[79] Fix | Delete
'span' => array(
[80] Fix | Delete
'class'=>array(),
[81] Fix | Delete
'data-tooltip'=>array(),
[82] Fix | Delete
'title'=>array(),
[83] Fix | Delete
)
[84] Fix | Delete
)); ?></li>
[85] Fix | Delete
<?php
[86] Fix | Delete
if (isset($conditional)) { echo '{{/if}}'; }
[87] Fix | Delete
endforeach;
[88] Fix | Delete
?>
[89] Fix | Delete
<?php if (count($detailControls)): ?>
[90] Fix | Delete
<li class="wf-issue-detail-controls"><?php echo implode("\n", $detailControls); ?></li>
[91] Fix | Delete
<?php endif; ?>
[92] Fix | Delete
</ul>
[93] Fix | Delete
</li>
[94] Fix | Delete
</ul>
[95] Fix | Delete
</script>
[96] Fix | Delete
<?php else: ?>
[97] Fix | Delete
<?php
[98] Fix | Delete
echo '[' . $displayType . ($textOutput['status'] == 'ignoreP' || $textOutput['status'] == 'ignoreP' ? ', ' . __('Ignored', 'wordfence') : '') . ']' . "\n";
[99] Fix | Delete
echo $textOutput['shortMsg'] . "\n";
[100] Fix | Delete
echo sprintf(/* translators: Localized date. */ __('Issue Found: %s', 'wordfence'), $textOutput['displayTime']) . "\n";
[101] Fix | Delete
$severity = null;
[102] Fix | Delete
switch ($textOutput['severity']) {
[103] Fix | Delete
case wfIssues::SEVERITY_CRITICAL:
[104] Fix | Delete
$severity = __('Critical', 'wordfence');
[105] Fix | Delete
break;
[106] Fix | Delete
case wfIssues::SEVERITY_HIGH:
[107] Fix | Delete
$severity = __('High', 'wordfence');
[108] Fix | Delete
break;
[109] Fix | Delete
case wfIssues::SEVERITY_MEDIUM:
[110] Fix | Delete
$severity = __('Medium', 'wordfence');
[111] Fix | Delete
break;
[112] Fix | Delete
case wfIssues::SEVERITY_LOW:
[113] Fix | Delete
$severity = __('Low', 'wordfence');
[114] Fix | Delete
break;
[115] Fix | Delete
default:
[116] Fix | Delete
$severity = __('None', 'wordfence');
[117] Fix | Delete
break;
[118] Fix | Delete
}
[119] Fix | Delete
if ($severity) {
[120] Fix | Delete
echo sprintf(/* translators: Severity level. */ __('Severity: %s', 'wordfence'), $severity) . "\n";
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
foreach ($textOutputDetailPairs as $label => $value) {
[124] Fix | Delete
if ($value === null) {
[125] Fix | Delete
echo "\n";
[126] Fix | Delete
continue;
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
unset($conditional);
[130] Fix | Delete
if (is_array($value)) {
[131] Fix | Delete
$conditional = $value[0];
[132] Fix | Delete
if (!is_array($conditional)) {
[133] Fix | Delete
$conditional = array($conditional);
[134] Fix | Delete
}
[135] Fix | Delete
$value = $value[1];
[136] Fix | Delete
}
[137] Fix | Delete
[138] Fix | Delete
$allow = true;
[139] Fix | Delete
if (isset($conditional)) {
[140] Fix | Delete
foreach ($conditional as $test) {
[141] Fix | Delete
if (!$allow) {
[142] Fix | Delete
break;
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
if (preg_match('/^!?\$(\S+)/', $test, $matches)) {
[146] Fix | Delete
$invert = (strpos($test, '!') === 0);
[147] Fix | Delete
$components = explode('.', $matches[1]);
[148] Fix | Delete
$tier = $textOutput;
[149] Fix | Delete
foreach ($components as $index => $c) {
[150] Fix | Delete
if (is_array($tier) && !isset($tier[$c])) {
[151] Fix | Delete
if (!$invert) {
[152] Fix | Delete
$allow = false;
[153] Fix | Delete
}
[154] Fix | Delete
break;
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
if ($index == count($components) - 1 && is_array($tier)) {
[158] Fix | Delete
if ((!$tier[$c] && !$invert) || ($tier[$c] && $invert)) {
[159] Fix | Delete
$allow = false;
[160] Fix | Delete
}
[161] Fix | Delete
break;
[162] Fix | Delete
}
[163] Fix | Delete
else if (!is_array($tier)) {
[164] Fix | Delete
$allow = false;
[165] Fix | Delete
break;
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
$tier = $tier[$c];
[169] Fix | Delete
}
[170] Fix | Delete
}
[171] Fix | Delete
}
[172] Fix | Delete
}
[173] Fix | Delete
[174] Fix | Delete
if (!$allow) {
[175] Fix | Delete
continue;
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
if (preg_match_all('/(?<=^|\s)\$(\S+)(?=$|\s)/', $value, $matches, PREG_OFFSET_CAPTURE)) {
[179] Fix | Delete
array_shift($matches);
[180] Fix | Delete
$matches = $matches[0];
[181] Fix | Delete
$matches = array_reverse($matches);
[182] Fix | Delete
foreach ($matches as $m) {
[183] Fix | Delete
$resolvedKeyPath = '';
[184] Fix | Delete
$components = explode('.', $m[0]);
[185] Fix | Delete
$tier = $textOutput;
[186] Fix | Delete
foreach ($components as $index => $c) {
[187] Fix | Delete
if (is_array($tier) && !isset($tier[$c])) {
[188] Fix | Delete
$allow = false;
[189] Fix | Delete
break 2;
[190] Fix | Delete
}
[191] Fix | Delete
[192] Fix | Delete
if ($index == count($components) - 1 && is_array($tier)) {
[193] Fix | Delete
$resolvedKeyPath = (string) $tier[$c];
[194] Fix | Delete
break;
[195] Fix | Delete
}
[196] Fix | Delete
else if (!is_array($tier)) {
[197] Fix | Delete
$allow = false;
[198] Fix | Delete
break 2;
[199] Fix | Delete
}
[200] Fix | Delete
[201] Fix | Delete
$tier = $tier[$c];
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
$value = substr($value, 0, $m[1] - 1) . strip_tags($resolvedKeyPath) . substr($value, $m[1] + strlen($m[0]));
[205] Fix | Delete
}
[206] Fix | Delete
}
[207] Fix | Delete
[208] Fix | Delete
if (!$allow) {
[209] Fix | Delete
continue;
[210] Fix | Delete
}
[211] Fix | Delete
[212] Fix | Delete
echo $label . ': ' . $value . "\n";
[213] Fix | Delete
}
[214] Fix | Delete
?>
[215] Fix | Delete
<?php endif; ?>
[216] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function