Esempio n. 1
0
                $pdo = new nzedb\db\DB();
                $preData = $pdo->query(sprintf('SELECT * FROM predb p INNER JOIN predbhash ph ON ph.pre_id = p.id WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', $pdo->escapeString($_GET['md5']), $newer, $older, $nuked, $limit, $offset));
            }
            break;
        case 's':
        case 'sha1':
            if (isset($_GET['sha1']) && strlen($_GET['sha1']) === 40) {
                $pdo = new nzedb\db\DB();
                $preData = $pdo->query(sprintf('SELECT * FROM predb p INNER JOIN predbhash ph ON ph.pre_id = p.id WHERE MATCH(hashes) AGAINST (%s) %s %s %s LIMIT %d OFFSET %d', $pdo->escapeString($_GET['sha1']), $newer, $older, $nuked, $limit, $offset));
            }
            break;
        case 'c':
        case 'category':
            if (isset($_GET['category'])) {
                $pdo = new nzedb\db\DB();
                $preData = $pdo->query(sprintf('SELECT * FROM predb p WHERE p.category %s %s %s %s LIMIT %d OFFSET %d', $newer, $older, $nuked, $pdo->likeString($_GET['category']), $limit, $offset));
            }
            break;
        case 'a':
        case 'all':
            $pdo = new nzedb\db\DB();
            $preData = $pdo->query(sprintf('SELECT * FROM predb p WHERE 1=1 %s %s %s ORDER BY p.predate DESC LIMIT %d OFFSET %d', $newer, $older, $nuked, $limit, $offset));
            break;
    }
} else {
    if (isset($_POST['data'])) {
        $reqData = @unserialize($_POST['data']);
        if ($reqData !== false && is_array($reqData) && isset($reqData[0]['ident'])) {
            $pdo = new nzedb\db\DB();
            $preData = array();
            foreach ($reqData as $request) {