Changeset 149

Show
Ignore:
Timestamp:
10/16/07 16:59:38 (15 months ago)
Author:
chris
Message:

Dropped support for the ctype library 12

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r148 r149  
    1111* Fixed a bug where the automatic refresh wouldn't update the final queue 
    1212  item when it began downloading [ticket:13] 
     13 
     14* Dropped requirement for the Ctype library [ticket:12] 
    1315 
    14161.8 
  • trunk/classes/HellaController.php

    r147 r149  
    408408                 */ 
    409409                        if ($articleid === false) throw new Exception('Invalid ID provided'); 
    410                         if (!ctype_digit($articleid)) { 
     410                        if (!preg_match('/^\d+$/', $articleid)) { 
    411411                                throw new Exception('Invalid Newzbin article ID provided'); 
    412412                        } 
     
    468468                 *      $rate must be an integer value containing the rate limit. 
    469469                 */ 
    470                         if (!ctype_digit($rate)) { 
     470                        if (!preg_match('/^\d+$/', $rate)) { 
    471471                                throw new Exception('Invalid rate provided'); 
    472472                        } 
  • trunk/index.php

    r145 r149  
    9898                $self = htmlentities($_SERVER['PHP_SELF']); 
    9999 
    100                 if (array_key_exists('id', $_GET) && ctype_digit($_GET['id'])) { 
     100                if (array_key_exists('id', $_GET) && preg_match('/^\d+$/', $_GET['id'])) { 
    101101                        $nzbid = $_GET['id']; 
    102102                } else { 
    103103                        $nzbid = false; 
    104104                } 
    105                 if (array_key_exists('action', $_GET) && ctype_digit($_GET['action'])) { 
     105                if (array_key_exists('action', $_GET) && preg_match('/^\d+$/', $_GET['action'])) { 
    106106                        switch ($_GET['action']) { 
    107107                                case 1: 
     
    150150                } 
    151151 
    152                 if (array_key_exists('refresher', $_GET) && ctype_digit($_GET['refresher'])) { 
     152                if (array_key_exists('refresher', $_GET) && preg_match('/^\d+$/', $_GET['refresher'])) { 
    153153                        if ($_GET['refresher'] == 1) { 
    154154                                include 'templates/json.php'; 
     
    157157                } 
    158158 
    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'])) { 
    160160                        $type = $_POST['sorttype']; 
    161161                        if ($type == 1 && array_key_exists('order', $_POST) && is_array($_POST['order'])) { 
     
    163163                                $c->multiCallStart(); 
    164164                                foreach($_POST['order'] as $queueindex => $neworder) { 
    165                                         if (ctype_digit($neworder) && $queueindex != $neworder) { 
     165                                        if (preg_match('/^\d+$/', $neworder) && $queueindex != $neworder) { 
    166166                                                $c->move($c->queue[$queueindex]['id'], $neworder); 
    167167                                        } 
    168168                                } 
    169169                                $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'])) { 
    171171                                $sortdir = $_POST['sortdirection']; 
    172172                                if ($type == 2) { 
     
    229229                if (array_key_exists('nzbdownload', $_GET)) { 
    230230                        $nzbdownload = trim($_GET['nzbdownload']); 
    231                         if (ctype_digit($nzbdownload)) { 
     231                        if (preg_match('/^\d+$/', $nzbdownload)) { 
    232232                                $c->enqueueNewzbin($nzbdownload); 
    233233                        } else { 
     
    248248                } 
    249249 
    250                 if (array_key_exists('maxrate', $_GET) && ctype_digit($_GET['maxrate'])) { 
     250                if (array_key_exists('maxrate', $_GET) && preg_match('/^\d+$/', $_GET['maxrate'])) { 
    251251                        $c->setRate($_GET['maxrate']); 
    252252                        header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . $self); 
    253253                } 
    254254 
    255                 if (array_key_exists('info', $_GET) && ctype_digit($_GET['info'])) { 
     255                if (array_key_exists('info', $_GET) && preg_match('/^\d+$/', $_GET['info'])) { 
    256256                        $index = $_GET['info'] - 1; 
    257257                        include 'templates/rarpass.php'; 
     
    286286                } 
    287287 
    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) { 
    289289                        $id = --$_GET['removefinished']; 
    290290                        if (isset($x->item[$id])) { 
  • trunk/progress.php

    r80 r149  
    4141        $height = 10; 
    4242 
    43         if (array_key_exists('percentage', $_GET) && ctype_digit($_GET['percentage'])) { 
     43        if (array_key_exists('percentage', $_GET) && preg_match('/^\d+$/', $_GET['percentage'])) { 
    4444                $percentage = $_GET['percentage']; 
    4545        } else {