From 3bb650404199a3cf3ae427a42086c4f6e79a86c1 Mon Sep 17 00:00:00 2001 From: Giuseppe Marcelli Date: Tue, 9 May 2017 23:30:14 +0200 Subject: read() in DB_cache does not fail when catching E_WARNING with custom error handler --- system/database/DB_cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index b74c31924..1c188234a 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -143,7 +143,7 @@ class CI_DB_Cache { $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); $filepath = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'.md5($sql); - if (FALSE === ($cachedata = @file_get_contents($filepath))) + if ( ! is_file($filepath) OR FALSE === ($cachedata = @file_get_contents($filepath))) { return FALSE; } -- cgit v1.2.3-24-g4f1b From 8233b1d6fc56347195b3a0411806e197e2e59ad3 Mon Sep 17 00:00:00 2001 From: Giuseppe Marcelli Date: Wed, 10 May 2017 02:12:31 +0200 Subject: Commit 4763c13c99eab2a720a4d6d913902e5cef4e76ec does not allow anymore to use the custom result object against cached database results, fixing this, for more info see issue 4665,1351 --- system/database/DB_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 98d8876a7..ed1642bdc 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -183,7 +183,7 @@ class CI_DB_result { { return $this->custom_result_object[$class_name]; } - elseif ( ! $this->result_id OR $this->num_rows === 0) + elseif ($this->result_id === FALSE OR $this->num_rows === 0) { return array(); } -- cgit v1.2.3-24-g4f1b From 0dbf6d3d501a5afcd1aa063c2eb0262df93c8fc6 Mon Sep 17 00:00:00 2001 From: Giuseppe Marcelli Date: Wed, 10 May 2017 10:29:24 +0200 Subject: Revert "Commit 4763c13c99eab2a720a4d6d913902e5cef4e76ec does not allow anymore to use the custom result object against cached database results, fixing this, for more info see issue 4665,1351" This reverts commit 8233b1d6fc56347195b3a0411806e197e2e59ad3. --- system/database/DB_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index ed1642bdc..98d8876a7 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -183,7 +183,7 @@ class CI_DB_result { { return $this->custom_result_object[$class_name]; } - elseif ($this->result_id === FALSE OR $this->num_rows === 0) + elseif ( ! $this->result_id OR $this->num_rows === 0) { return array(); } -- cgit v1.2.3-24-g4f1b From 07ccf2cbd2d8d09c094337f43feb3c3da91cbb6f Mon Sep 17 00:00:00 2001 From: Giuseppe Marcelli Date: Wed, 10 May 2017 10:32:09 +0200 Subject: Removing the error suppression op from the file_get_contents() call. --- system/database/DB_cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index 1c188234a..7c8ee5fc9 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -143,7 +143,7 @@ class CI_DB_Cache { $segment_two = ($this->CI->uri->segment(2) == FALSE) ? 'index' : $this->CI->uri->segment(2); $filepath = $this->db->cachedir.$segment_one.'+'.$segment_two.'/'.md5($sql); - if ( ! is_file($filepath) OR FALSE === ($cachedata = @file_get_contents($filepath))) + if ( ! is_file($filepath) OR FALSE === ($cachedata = file_get_contents($filepath))) { return FALSE; } -- cgit v1.2.3-24-g4f1b