Exemple #1
0
                redirect('image');
                Lunor::$base->router->forPage('image');
                return true;
            } else {
                redirect('file');
                Lunor::$base->router->forPage('file');
                return true;
            }
        }
    }
});
Routing::custom('f', function ($extra) {
    if ($extra != false) {
        $pasteId = $extra;
        /* get the paste for the id supplied within the extra */
        $paste = PasteHandler_PasteAPI::forId($pasteId);
        if ($paste === true) {
            /* paste threw its one error when fetching id */
            return true;
        } else {
            if ($paste === false) {
                Lunor::$base->router->throwError(404);
                return true;
            }
        }
        if (file_exists($paste->datapath)) {
            header('Content-Description: File Transfer');
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename=' . basename($paste->datapath));
            header('Content-Transfer-Encoding: binary');
            header('Expires: 0');
Exemple #2
0
<?php

if (!empty($_POST)) {
    echo PasteHandler_PasteAPI::upload();
}
Exemple #3
0
 public function findAuthor()
 {
     return PasteHandler_PasteAPI::findAuthor($this);
 }