public function SiteAuditCheckSecurityMenuRouter::getResultFail in Site Audit 8.2
Same name and namespace in other branches
- 7 Check/Security/MenuRouter.php \SiteAuditCheckSecurityMenuRouter::getResultFail()
Implements \SiteAudit\Check\Abstract\getResultFail().
Overrides SiteAuditCheckAbstract::getResultFail
File
- Check/
Security/ MenuRouter.php, line 29 - Contains \SiteAudit\Check\Security\MenuRouter.
Class
- SiteAuditCheckSecurityMenuRouter
- Class SiteAuditCheckSecurityMenuRouter.
Code
public function getResultFail() {
$ret_val = dt('The following potentially malicious paths have been discovered: @list', array(
'@list' => implode(', ', array_keys($this->registry['menu_router'])),
));
if (drush_get_option('detail')) {
if (drush_get_option('html')) {
$ret_val .= '<br/>';
$ret_val .= '<table class="table table-condensed">';
$ret_val .= '<thead><tr><th>' . dt('Path') . '</th><th>' . dt('Reason') . '</th></thead>';
$ret_val .= '<tbody>';
foreach ($this->registry['menu_router'] as $path => $malicious_callbacks) {
foreach ($malicious_callbacks as $malicious_callback) {
$ret_val .= '<tr><td>' . $path . '</td><td>' . $malicious_callback . '</td></tr>';
}
}
$ret_val .= '</tbody>';
$ret_val .= '</table>';
}
else {
foreach ($this->registry['menu_router'] as $path => $malicious_callbacks) {
foreach ($malicious_callbacks as $malicious_callback) {
$ret_val .= PHP_EOL;
if (!drush_get_option('json')) {
$ret_val .= str_repeat(' ', 6);
}
$ret_val .= '- ' . $path . ': ' . $malicious_callback;
}
}
}
}
return $ret_val;
}