You are here

public function SiteAuditCheckSecurityMenuRouter::getResultFail in Site Audit 7

Same name and namespace in other branches
  1. 8.2 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 => $reason) {
        $ret_val .= '<tr><td>' . $path . '</td><td>' . $reason . '</td></tr>';
      }
      $ret_val .= '</tbody>';
      $ret_val .= '</table>';
    }
    else {
      foreach ($this->registry['menu_router'] as $path => $reason) {
        $ret_val .= PHP_EOL;
        if (!drush_get_option('json')) {
          $ret_val .= str_repeat(' ', 6);
        }
        $ret_val .= '- ' . $path . ': ' . $reason;
      }
    }
  }
  return $ret_val;
}