Changeset 149
- Timestamp:
- 10/16/07 16:59:38 (15 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
CHANGELOG (modified) (1 diff)
-
classes/HellaController.php (modified) (2 diffs)
-
index.php (modified) (7 diffs)
-
progress.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r148 r149 11 11 * Fixed a bug where the automatic refresh wouldn't update the final queue 12 12 item when it began downloading [ticket:13] 13 14 * Dropped requirement for the Ctype library [ticket:12] 13 15 14 16 1.8 -
trunk/classes/HellaController.php
r147 r149 408 408 */ 409 409 if ($articleid === false) throw new Exception('Invalid ID provided'); 410 if (! ctype_digit($articleid)) {410 if (!preg_match('/^\d+$/', $articleid)) { 411 411 throw new Exception('Invalid Newzbin article ID provided'); 412 412 } … … 468 468 * $rate must be an integer value containing the rate limit. 469 469 */ 470 if (! ctype_digit($rate)) {470 if (!preg_match('/^\d+$/', $rate)) { 471 471 throw new Exception('Invalid rate provided'); 472 472 } -
trunk/index.php
r145 r149 98 98 $self = htmlentities($_SERVER['PHP_SELF']); 99 99 100 if (array_key_exists('id', $_GET) && ctype_digit($_GET['id'])) {100 if (array_key_exists('id', $_GET) && preg_match('/^\d+$/', $_GET['id'])) { 101 101 $nzbid = $_GET['id']; 102 102 } else { 103 103 $nzbid = false; 104 104 } 105 if (array_key_exists('action', $_GET) && ctype_digit($_GET['action'])) {105 if (array_key_exists('action', $_GET) && preg_match('/^\d+$/', $_GET['action'])) { 106 106 switch ($_GET['action']) { 107 107 case 1: … … 150 150 } 151 151 152 if (array_key_exists('refresher', $_GET) && ctype_digit($_GET['refresher'])) {152 if (array_key_exists('refresher', $_GET) && preg_match('/^\d+$/', $_GET['refresher'])) { 153 153 if ($_GET['refresher'] == 1) { 154 154 include 'templates/json.php'; … … 157 157 } 158 158 159 if (array_key_exists('reorder', $_POST) && array_key_exists('sorttype', $_POST) && ctype_digit($_POST['sorttype'])) {159 if (array_key_exists('reorder', $_POST) && array_key_exists('sorttype', $_POST) && preg_match('/^\d+$/', $_POST['sorttype'])) { 160 160 $type = $_POST['sorttype']; 161 161 if ($type == 1 && array_key_exists('order', $_POST) && is_array($_POST['order'])) { … … 163 163 $c->multiCallStart(); 164 164 foreach($_POST['order'] as $queueindex => $neworder) { 165 if ( ctype_digit($neworder) && $queueindex != $neworder) {165 if (preg_match('/^\d+$/', $neworder) && $queueindex != $neworder) { 166 166 $c->move($c->queue[$queueindex]['id'], $neworder); 167 167 } 168 168 } 169 169 $c->multiCallCommit(); 170 } elseif (array_key_exists('sortdirection', $_POST) && ctype_digit($_POST['sortdirection'])) {170 } elseif (array_key_exists('sortdirection', $_POST) && preg_match('/^\d+$/', $_POST['sortdirection'])) { 171 171 $sortdir = $_POST['sortdirection']; 172 172 if ($type == 2) { … … 229 229 if (array_key_exists('nzbdownload', $_GET)) { 230 230 $nzbdownload = trim($_GET['nzbdownload']); 231 if ( ctype_digit($nzbdownload)) {231 if (preg_match('/^\d+$/', $nzbdownload)) { 232 232 $c->enqueueNewzbin($nzbdownload); 233 233 } else { … … 248 248 } 249 249 250 if (array_key_exists('maxrate', $_GET) && ctype_digit($_GET['maxrate'])) {250 if (array_key_exists('maxrate', $_GET) && preg_match('/^\d+$/', $_GET['maxrate'])) { 251 251 $c->setRate($_GET['maxrate']); 252 252 header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . $self); 253 253 } 254 254 255 if (array_key_exists('info', $_GET) && ctype_digit($_GET['info'])) {255 if (array_key_exists('info', $_GET) && preg_match('/^\d+$/', $_GET['info'])) { 256 256 $index = $_GET['info'] - 1; 257 257 include 'templates/rarpass.php'; … … 286 286 } 287 287 288 if (array_key_exists('removefinished', $_GET) && ctype_digit($_GET['removefinished']) && $x) {288 if (array_key_exists('removefinished', $_GET) && preg_match('/^\d+$/', $_GET['removefinished']) && $x) { 289 289 $id = --$_GET['removefinished']; 290 290 if (isset($x->item[$id])) { -
trunk/progress.php
r80 r149 41 41 $height = 10; 42 42 43 if (array_key_exists('percentage', $_GET) && ctype_digit($_GET['percentage'])) {43 if (array_key_exists('percentage', $_GET) && preg_match('/^\d+$/', $_GET['percentage'])) { 44 44 $percentage = $_GET['percentage']; 45 45 } else {
