From 345e7ee1c655c53b8022c3e725a4266e15bd2542 Mon Sep 17 00:00:00 2001 From: Ronald Beilsma Date: Wed, 28 Dec 2011 12:59:04 +0100 Subject: fixed bug in pagination library return value of ceil is of type float --- system/libraries/Pagination.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 008c15192..d10bef3e5 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -131,7 +131,7 @@ class CI_Pagination { $num_pages = ceil($this->total_rows / $this->per_page); // Is there only one page? Hm... nothing more to do here then. - if ($num_pages === 1) + if ($num_pages == 1) { return ''; } -- cgit v1.2.3-24-g4f1b From 64b013611f65006197fdf465186ca36adf12847d Mon Sep 17 00:00:00 2001 From: Ronald Beilsma Date: Wed, 28 Dec 2011 12:59:45 +0100 Subject: fixed bug in typography library array index starts at 0, not 1 --- system/libraries/Typography.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index 651ba7bff..ac9486a6b 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -144,7 +144,7 @@ class CI_Typography { $process = TRUE; $paragraph = FALSE; - for ($i = 1, $c = count($chunks); $i <= $c; $i++) + for ($i = 0, $c = count($chunks) - 1; $i <= $c; $i++) { // Are we dealing with a tag? If so, we'll skip the processing for this cycle. // Well also set the "process" flag which allows us to skip
 tags and a few other things.
-- 
cgit v1.2.3-24-g4f1b


From cfb7021e9f53fa089bfd676978b448b27e4bd996 Mon Sep 17 00:00:00 2001
From: Ronald Beilsma 
Date: Thu, 29 Dec 2011 09:57:49 +0100
Subject: ceil returned float (line 131), so if statement in line 134 was bound
 to return false (===, float vs integer)

---
 system/libraries/Pagination.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'system')

diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index d10bef3e5..63b750bdb 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -128,10 +128,10 @@ class CI_Pagination {
 		}
 
 		// Calculate the total number of pages
-		$num_pages = ceil($this->total_rows / $this->per_page);
+		$num_pages = (int) ceil($this->total_rows / $this->per_page);
 
 		// Is there only one page? Hm... nothing more to do here then.
-		if ($num_pages == 1)
+		if ($num_pages === 1)
 		{
 			return '';
 		}
-- 
cgit v1.2.3-24-g4f1b


From 57f58a27df738408a06307442a9a344414e90016 Mon Sep 17 00:00:00 2001
From: Ronald Beilsma 
Date: Tue, 10 Jan 2012 15:59:06 +0100
Subject: closedir closes directory handle, not directory path

---
 system/helpers/file_helper.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'system')

diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 9b39b8c20..d76d85691 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -205,7 +205,7 @@ if ( ! function_exists('get_filenames'))
 					$_filedata[] = ($include_path == TRUE) ? $source_dir.$file : $file;
 				}
 			}
-			closedir($source_dir);
+			closedir($fp);
 
 			return $_filedata;
 		}
-- 
cgit v1.2.3-24-g4f1b


From 92fcffa6c76a2010ee7a2162554b304ba7cf0549 Mon Sep 17 00:00:00 2001
From: Ronald Beilsma 
Date: Tue, 10 Jan 2012 16:11:00 +0100
Subject: closedir closes directory handle, not directory path

---
 system/helpers/file_helper.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'system')

diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index d76d85691..89b2a54db 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -259,7 +259,7 @@ if ( ! function_exists('get_dir_file_info'))
 					$_filedata[$file]['relative_path'] = $relative_path;
 				}
 			}
-			closedir($source_dir);
+			closedir($fp);
 
 			return $_filedata;
 		}
-- 
cgit v1.2.3-24-g4f1b


From 8f80bc4f855f78efbcb6344ea29cf67647b6772b Mon Sep 17 00:00:00 2001
From: Ronald Beilsma 
Date: Thu, 12 Jan 2012 16:41:49 +0100
Subject: array keys should be 0, 1, and 2. key 3 results in error (invalid
 offset)

---
 system/libraries/Image_lib.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'system')

diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index dc7d362ce..a226ae8f8 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1091,7 +1091,7 @@ class CI_Image_lib {
 			$txt_color = str_split(substr($this->wm_font_color, 1, 6), 2);
 			$txt_color = imagecolorclosest($src_img, hexdec($txt_color[0]), hexdec($txt_color[1]), hexdec($txt_color[2]));
 			$drp_color = str_split(substr($this->wm_shadow_color, 1, 6), 2);
-			$drp_color = imagecolorclosest($src_img, hexdec($drp_color[0]), hexdec($drp_color[2]), hexdec($drp_color[3]));
+			$drp_color = imagecolorclosest($src_img, hexdec($drp_color[0]), hexdec($drp_color[1]), hexdec($drp_color[2]));
 
 			//  Add the text to the source image
 			if ($this->wm_use_truetype)
-- 
cgit v1.2.3-24-g4f1b