Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 1 | <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
| 2 | /**
|
| 3 | * CodeIgniter
|
| 4 | *
|
| 5 | * An open source application development framework for PHP 4.3.2 or newer
|
| 6 | *
|
| 7 | * @package CodeIgniter
|
| 8 | * @author ExpressionEngine Dev Team
|
| 9 | * @copyright Copyright (c) 2006, EllisLab, Inc.
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 10 | * @license http://codeigniter.com/user_guide/license.html
|
| 11 | * @link http://codeigniter.com
|
Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 12 | * @since Version 1.0
|
| 13 | * @filesource
|
| 14 | */
|
| 15 |
|
| 16 | // ------------------------------------------------------------------------
|
| 17 |
|
| 18 | /**
|
| 19 | * Compatibility Functions
|
| 20 | *
|
| 21 | * Function overrides for older versions of PHP or PHP environments missing
|
| 22 | * certain extensions / libraries
|
| 23 | *
|
| 24 | * @package CodeIgniter
|
| 25 | * @subpackage codeigniter
|
| 26 | * @category Compatibility Functions
|
Derek Allard | b2bbd61 | 2008-01-18 19:59:29 +0000 | [diff] [blame] | 27 | * @author ExpressionEngine Development Team
|
Derek Jones | 7a9193a | 2008-01-21 18:39:20 +0000 | [diff] [blame] | 28 | * @link http://codeigniter.com/user_guide/
|
Derek Allard | 3d879d5 | 2008-01-18 19:41:32 +0000 | [diff] [blame] | 29 | */
|
| 30 |
|
| 31 | // ------------------------------------------------------------------------
|
| 32 |
|
| 33 | /*
|
| 34 | * PHP versions prior to 5.0 don't support the E_STRICT constant
|
| 35 | * so we need to explicitly define it otherwise the Exception class
|
| 36 | * will generate errors when running under PHP 4
|
| 37 | *
|
| 38 | */
|
| 39 | if ( ! defined('E_STRICT'))
|
| 40 | {
|
| 41 | define('E_STRICT', 2048);
|
| 42 | }
|
| 43 |
|
| 44 | /**
|
| 45 | * ctype_digit()
|
| 46 | *
|
| 47 | * Determines if a string is comprised only of digits
|
| 48 | * http://us.php.net/manual/en/function.ctype_digit.php
|
| 49 | *
|
| 50 | * @access public
|
| 51 | * @param string
|
| 52 | * @return bool
|
| 53 | */
|
| 54 | if (! function_exists('ctype_digit'))
|
| 55 | {
|
| 56 | function ctype_digit($str)
|
| 57 | {
|
| 58 | if (! is_string($str) OR $str == '')
|
| 59 | {
|
| 60 | return FALSE;
|
| 61 | }
|
| 62 |
|
| 63 | return ! preg_match('/[^0-9]/', $str);
|
| 64 | }
|
| 65 | }
|
| 66 |
|
| 67 | // --------------------------------------------------------------------
|
| 68 |
|
| 69 | /**
|
| 70 | * ctype_alnum()
|
| 71 | *
|
| 72 | * Determines if a string is comprised of only alphanumeric characters
|
| 73 | * http://us.php.net/manual/en/function.ctype-alnum.php
|
| 74 | *
|
| 75 | * @access public
|
| 76 | * @param string
|
| 77 | * @return bool
|
| 78 | */
|
| 79 | if (! function_exists('ctype_alnum'))
|
| 80 | {
|
| 81 | function ctype_alnum($str)
|
| 82 | {
|
| 83 | if (! is_string($str) OR $str == '')
|
| 84 | {
|
| 85 | return FALSE;
|
| 86 | }
|
| 87 |
|
| 88 | return ! preg_match('/[^0-9a-z]/i', $str);
|
| 89 | }
|
| 90 | }
|
| 91 |
|
| 92 | // --------------------------------------------------------------------
|
| 93 |
|
Derek Jones | 9884449 | 2008-01-16 22:26:37 +0000 | [diff] [blame] | 94 | ?> |