getBugFixes() публичный Метод

public getBugFixes ( )
Пример #1
0
 public function dependsOn()
 {
     $data = new Methods();
     $this->bugfixes = $data->getBugFixes();
     $depends = array();
     foreach ($this->bugfixes as $bugfix) {
         if (!empty($bugfix['analyzer'])) {
             $depends[] = $bugfix['analyzer'];
         }
     }
     return $depends;
 }
Пример #2
0
 protected function generateBugfixes()
 {
     $table = '';
     $data = new Methods();
     $bugfixes = $data->getBugFixes();
     $found = $this->sqlite->query('SELECT * FROM results WHERE analyzer = "Php/MiddleVersion"');
     $reported = array();
     $info = array();
     $rows = array();
     while ($row = $found->fetchArray()) {
         $rows[strtolower(substr($row['fullcode'], 0, strpos($row['fullcode'], '(')))] = $row;
     }
     foreach ($bugfixes as $bugfix) {
         if (!empty($bugfix['function'])) {
             if (!isset($rows[$bugfix['function']])) {
                 continue;
             }
             $cve = $this->Bugfixes_cve($bugfix['cve']);
             $table .= '<tr>
 <td>' . $bugfix['title'] . '</td>
 <td>' . ($bugfix['solvedIn71'] ? $bugfix['solvedIn71'] : '-') . '</td>
 <td>' . ($bugfix['solvedIn70'] ? $bugfix['solvedIn70'] : '-') . '</td>
 <td>' . ($bugfix['solvedIn56'] ? $bugfix['solvedIn56'] : '-') . '</td>
 <td>' . ($bugfix['solvedIn55'] ? $bugfix['solvedIn55'] : '-') . '</td>
 <td>' . ($bugfix['solvedInDev'] ? $bugfix['solvedInDev'] : '-') . '</td>
 <td><a href="https://bugs.php.net/bug.php?id=' . $bugfix['bugs'] . '">#' . $bugfix['bugs'] . '</a></td>
 <td>' . $cve . '</td>
             </tr>';
         } elseif (!empty($bugfix['analyzer'])) {
             $subanalyze = $this->sqlite->querySingle('SELECT count FROM resultsCounts WHERE analyzer = "' . $bugfix['analyzer'] . '"');
             $cve = $this->Bugfixes_cve($bugfix['cve']);
             if ($subanalyze == 0) {
                 continue;
             }
             $table .= '<tr>
 <td>' . $bugfix['title'] . '</td>
 <td>' . ($bugfix['solvedIn71'] ? $bugfix['solvedIn71'] : '-') . '</td>
 <td>' . ($bugfix['solvedIn70'] ? $bugfix['solvedIn70'] : '-') . '</td>
 <td>' . ($bugfix['solvedIn56'] ? $bugfix['solvedIn56'] : '-') . '</td>
 <td>' . ($bugfix['solvedIn55'] ? $bugfix['solvedIn55'] : '-') . '</td>
 <td>' . ($bugfix['solvedInDev'] ? $bugfix['solvedInDev'] : '-') . '</td>
 <td><a href="https://bugs.php.net/bug.php?id=' . $bugfix['bugs'] . '">#' . $bugfix['bugs'] . '</a></td>
 <td>' . $cve . '</td>
             </tr>';
         } else {
             continue;
             // ignore. Possibly some mis-configuration
         }
     }
     $html = $this->getBasedPage('bugfixes');
     $html = $this->injectBloc($html, 'BUG_FIXES', $table);
     $this->putBasedPage('bugfixes', $html);
 }
Пример #3
0
 protected function Bugfixes()
 {
     $css = new \Stdclass();
     $css->displayTitles = true;
     $css->titles = array('Title', 'Solved In 7.0', 'Solved In 5.6', 'Solved In 5.5', 'Solved In php-src', 'bugs.php.net', 'CVE');
     $css->readOrder = $css->titles;
     $data = new Methods();
     $bugfixes = $data->getBugFixes();
     $found = $this->dump->query('SELECT * FROM results WHERE analyzer = "Php/MiddleVersion"');
     $reported = array();
     $info = array();
     $rows = array();
     while ($row = $found->fetchArray()) {
         $rows[strtolower(substr($row['fullcode'], 0, strpos($row['fullcode'], '(')))] = $row;
     }
     foreach ($bugfixes as $bugfix) {
         if (!empty($bugfix['function'])) {
             if (!isset($rows[$bugfix['function']])) {
                 continue;
             }
             $cve = $this->Bugfixes_cve($bugfix['cve']);
             $info[] = array('title' => $bugfix['title'], 'solvedIn70' => $bugfix['solvedIn70'] ? $bugfix['solvedIn70'] : '-', 'solvedIn56' => $bugfix['solvedIn56'] ? $bugfix['solvedIn56'] : '-', 'solvedIn55' => $bugfix['solvedIn55'] ? $bugfix['solvedIn55'] : '-', 'solvedInDev' => $bugfix['solvedInDev'] ? $bugfix['solvedInDev'] : '-', 'bug' => '<a href="https://bugs.php.net/bug.php?id=' . $bugfix['bugs'] . '">#' . $bugfix['bugs'] . '</a>', 'cve' => $cve);
         } elseif (!empty($bugfix['analyzer'])) {
             $subanalyze = $this->dump->querySingle('SELECT COUNT(*) FROM results WHERE analyzer = "' . $bugfix['analyzer'] . '"');
             $cve = $this->Bugfixes_cve($bugfix['cve']);
             if ($subanalyze > 0) {
                 $info[] = array('title' => $bugfix['title'], 'solvedIn70' => $bugfix['solvedIn70'] ? $bugfix['solvedIn70'] : '-', 'solvedIn56' => $bugfix['solvedIn56'] ? $bugfix['solvedIn56'] : '-', 'solvedIn55' => $bugfix['solvedIn55'] ? $bugfix['solvedIn55'] : '-', 'solvedInDev' => $bugfix['solvedInDev'] ? $bugfix['solvedInDev'] : '-', 'bug' => 'ext/' . $bugfix['extension'], 'cve' => $cve);
             }
         } else {
             continue;
             // ignore. Possibly some mis-configuration
         }
     }
     return $this->formatCompilationTable($info, $css);
 }