summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2009-08-06 16:39:25 +0200
committerDerek Jones <derek.jones@ellislab.com>2009-08-06 16:39:25 +0200
commit77b513b821bf6df4b3afd4b841db93999632050e (patch)
tree190beb967d9b0aae3421b67e0a6eecb38f82b7ee
parent962d2258f9b2f2b8e3dbce7368b69673e839eb54 (diff)
fixed a bug in r1718 where the PHP version key was cast as float in a particular test, making the array keys used by is_php() inaccurate beyond whole number versions
http://codeigniter.com/bug_tracker/bug/8475/
-rw-r--r--system/codeigniter/CodeIgniter.php2
-rw-r--r--system/codeigniter/Common.php6
2 files changed, 5 insertions, 3 deletions
diff --git a/system/codeigniter/CodeIgniter.php b/system/codeigniter/CodeIgniter.php
index 5cf7d2fdc..1671287d0 100644
--- a/system/codeigniter/CodeIgniter.php
+++ b/system/codeigniter/CodeIgniter.php
@@ -58,7 +58,7 @@ require(APPPATH.'config/constants'.EXT);
*/
set_error_handler('_exception_handler');
-if ( ! is_php(5.3))
+if ( ! is_php('5.3'))
{
@set_magic_quotes_runtime(0); // Kill magic quotes
}
diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php
index 1ffed6a0c..6d3202d1b 100644
--- a/system/codeigniter/Common.php
+++ b/system/codeigniter/Common.php
@@ -36,12 +36,14 @@
* we'll set a static variable.
*
* @access public
-* @return bool
+* @param string
+* * @return bool
*/
function is_php($version = '5.0.0')
{
static $_is_php;
-
+ $version = (string)$version;
+
if ( ! isset($_is_php[$version]))
{
$_is_php[$version] = (version_compare(PHP_VERSION, $version) < 0) ? FALSE : TRUE;