diff options
Diffstat (limited to 'frontend/pages/upload.php')
-rw-r--r-- | frontend/pages/upload.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/frontend/pages/upload.php b/frontend/pages/upload.php index 04f8036..5f71eb3 100644 --- a/frontend/pages/upload.php +++ b/frontend/pages/upload.php @@ -1,18 +1,17 @@ <?php -function init_upload() { - global $S, $request; - if (!(isset($request['build'], $request['key'], $_FILES['file']) && preg_match('/^[a-zA-Z0-9]{6}$/', $request['build']) && preg_match('/^[a-zA-Z0-9]{30}$/', $request['key']))) { +function init_upload(&$S) { + if (!(isset($_REQUEST['build'], $_REQUEST['key'], $_FILES['file']) && preg_match('/^[a-zA-Z0-9]{6}$/', $_REQUEST['build']) && preg_match('/^[a-zA-Z0-9]{30}$/', $_REQUEST['key']))) { debug('upload', 'missing or malformed input'); return '404'; } - $r=$S['pdo']->query('SELECT * FROM `builds` WHERE `id`="'.$request['build'].'"'); + $r=query('SELECT * FROM `builds` WHERE `id`="'.$_REQUEST['build'].'"'); if ($r->rowCount() == 0) { debug('upload', 'build not found'); return '404'; } $build=new sql_build($r->fetch(PDO::FETCH_ASSOC)); $opts=$build->get_opts(); - if (!(isset($opts['uploadkey']) && $opts['uploadkey'] == $request['key'])) { + if (!(isset($opts['uploadkey']) && $opts['uploadkey'] == $_REQUEST['key'])) { debug('upload', 'invalid upload key'); return '404'; } |