Fix E_NOTICE: Only variables should be passed by reference
[phorkie.git] / www / delete.php
1 <?php
2 namespace phorkie;
3 /**
4  * Delete paste or ask for deletion
5  */
6 $reqWritePermissions = true;
7 require_once 'www-header.php';
8
9 $repo = new Repository();
10 $repo->loadFromRequest();
11
12 if (isset($_GET['confirm']) && $_GET['confirm'] == 1) {
13     if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
14         throw new Exception_Input('Deleting only possible via POST');
15     }
16     $repo->delete();
17     redirect(Tools::fullUrl());
18 }
19
20 render(
21     'delete',
22     array('repo' => $repo)
23 );
24 ?>