Merge pull request #2077 from AndrewPodner/develop

update for Issue #2064 - take 2
diff --git a/system/core/Common.php b/system/core/Common.php
index 7feb16b..c7ab387 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -681,17 +681,22 @@
 		{
 			if ( ! isset($_suhosin_func_blacklist))
 			{
-				$_suhosin_func_blacklist = extension_loaded('suhosin')
-					? array()
-					: explode(',', trim(@ini_get('suhosin.executor.func.blacklist')));
-
-				if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval'))
+				if (extension_loaded('suhosin'))
 				{
-					$_suhosin_func_blacklist[] = 'eval';
+					$_suhosin_func_blacklist = explode(',', trim(@ini_get('suhosin.executor.func.blacklist')));
+
+					if ( ! in_array('eval', $_suhosin_func_blacklist, TRUE) && @ini_get('suhosin.executor.disable_eval'))
+					{
+						$_suhosin_func_blacklist[] = 'eval';
+					}
+				}
+				else
+				{
+					$_suhosin_func_blacklist = array();
 				}
 			}
 
-			return in_array($function_name, $_suhosin_func_blacklist, TRUE);
+			return ! in_array($function_name, $_suhosin_func_blacklist, TRUE);
 		}
 
 		return FALSE;
diff --git a/system/core/Output.php b/system/core/Output.php
index 7a7380c..78eb8c6 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -780,6 +780,7 @@
 			break;
 
 			case 'text/css':
+			case 'text/javascript':
 
 				//Remove CSS comments
 				$output = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $output);
@@ -788,11 +789,12 @@
 				// semi-colons, parenthesis, commas
 				$output = preg_replace('!\s*(:|;|,|}|{|\(|\))\s*!', '$1', $output);
 
-			break;
+				// Remove spaces
+			        $output =  preg_replace('/  /s', ' ', $output);
 
-			case 'text/javascript':
+			        // Remove breaklines and tabs
+			        $output =  preg_replace('/[\r\n\t]/', '', $output);
 
-				// Currently leaves JavaScript untouched.
 			break;
 
 			default: break;
@@ -804,4 +806,4 @@
 }
 
 /* End of file Output.php */
-/* Location: ./system/core/Output.php */
\ No newline at end of file
+/* Location: ./system/core/Output.php */
diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php
index 6d926ae..9392a4d 100644
--- a/system/libraries/Session/drivers/Session_cookie.php
+++ b/system/libraries/Session/drivers/Session_cookie.php
@@ -457,7 +457,7 @@
 			}
 
 			// No result? Kill it!
-			if ($query->num_rows() === 0)
+			if (empty($query) OR $query->num_rows() === 0)
 			{
 				$this->sess_destroy();
 				return FALSE;
diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php
index 77cc45b..740e99c 100644
--- a/system/libraries/Zip.php
+++ b/system/libraries/Zip.php
@@ -133,7 +133,7 @@
 	protected function _get_mod_time($dir)
 	{
 		// filemtime() may return false, but raises an error for non-existing files
-		$date = file_exists($dir) ? filemtime($dir) : getdate($this->now);
+		$date = file_exists($dir) ? @filemtime($dir) : getdate($this->now);
 
 		return array(
 				'file_mtime' => ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2,
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 61c7941..a3d2905 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -327,9 +327,9 @@
 -  Fixed a bug (#181) where a mis-spelling was in the form validation language file.
 -  Fixed a bug (#159, #163) that mishandled Query Builder nested transactions because _trans_depth was not getting incremented.
 -  Fixed a bug (#737, #75) - :doc:`Pagination <libraries/pagination>` anchor class was not set properly when using initialize method.
--  Fixed a bug (#419) - auto_link() now recognizes URLs that come after a word boundary.
--  Fixed a bug (#724) - is_unique in form validation now checks that you are connected to a database.
--  Fixed a bug (#647) - _get_mod_time() in Zip library no longer generates stat failed errors.
+-  Fixed a bug (#419) - ``auto_link()`` now recognizes URLs that come after a word boundary.
+-  Fixed a bug (#724) - :doc:`Form Validation Library <libraries/form_validation>` rule **is_unique** didn't check if a database connection exists.
+-  Fixed a bug (#647) - :doc:`Zip Library <libraries/zip>` internal method ``_get_mod_time()`` didn't suppress possible "stat failed" errors generated by ``filemtime()``.
 -  Fixed a bug (#608) - Fixes an issue with the Image_lib class not clearing properties completely.
 -  Fixed a bug (#157, #174) - the Image_lib clear() function now resets all variables to their default values.
 -  Fixed a bug where using $this->dbforge->create_table() with PostgreSQL database could lead to fetching whole table.