Exakat\Reports\Ambassador::generateBugfixes PHP Method

generateBugfixes() protected method

protected generateBugfixes ( )
    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);
    }