Merge pull request #307 from kylefarris/isue-276

Fix for Issue #276 - Thanks Kyle!
diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php
index de75719..79d91b3 100644
--- a/system/libraries/Cache/drivers/Cache_apc.php
+++ b/system/libraries/Cache/drivers/Cache_apc.php
@@ -132,7 +132,7 @@
 	 */
 	public function is_supported()
 	{
-		if ( ! extension_loaded('apc') OR ! function_exists('apc_store'))
+		if ( ! extension_loaded('apc') OR ini_get('apc.enabled') != "1")
 		{
 			log_message('error', 'The APC PHP extension must be loaded to use APC Cache.');
 			return FALSE;
@@ -148,4 +148,4 @@
 // End Class
 
 /* End of file Cache_apc.php */
-/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */
\ No newline at end of file
+/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index 8ee08c5..867314b 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -688,13 +688,7 @@
 	{
 		if (is_array($data))
 		{
-			foreach ($data as $key => $val)
-			{
-				if (is_string($val))
-				{
-					$data[$key] = str_replace('\\', '{{slash}}', $val);
-				}
-			}
+			array_walk_recursive($data, array(&$this, '_escape_slashes'));
 		}
 		else
 		{
@@ -703,9 +697,23 @@
 				$data = str_replace('\\', '{{slash}}', $data);
 			}
 		}
-
 		return serialize($data);
 	}
+	
+	/**
+	 * Escape slashes
+	 *
+	 * This function converts any slashes found into a temporary marker
+	 *
+	 * @access	private
+	 */
+	function _escape_slashes(&$val, $key)
+	{
+		if (is_string($val))
+		{
+			$val = str_replace('\\', '{{slash}}', $val);
+		}
+	}
 
 	// --------------------------------------------------------------------
 
@@ -725,19 +733,27 @@
 
 		if (is_array($data))
 		{
-			foreach ($data as $key => $val)
-			{
-				if (is_string($val))
-				{
-					$data[$key] = str_replace('{{slash}}', '\\', $val);
-				}
-			}
-
+			array_walk_recursive($data, array(&$this, '_unescape_slashes'));
 			return $data;
 		}
 
 		return (is_string($data)) ? str_replace('{{slash}}', '\\', $data) : $data;
 	}
+	
+	/**
+	 * Unescape slashes
+	 *
+	 * This function converts any slash markers back into actual slashes
+	 *
+	 * @access	private
+	 */
+	function _unescape_slashes(&$val, $key)
+	{
+		if (is_string($val))
+		{
+	 		$val= str_replace('{{slash}}', '\\', $val);
+		}
+	}
 
 	// --------------------------------------------------------------------
 
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index d0b9352..906e2eb 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -111,6 +111,7 @@
 -  Fixed a bug (#484) - First time _csrf_set_hash() is called, hash is never set to the cookie (in Security.php).
 -  Fixed a bug (#60) - Added _file_mime_type() method to the `File Uploading Library <libraries/file_uploading>` in order to fix a possible MIME-type injection.
 -  Fixed a bug (#537) - Support for all wav type in browser.
+-  Fixed a bug (#576) - Using ini_get() function to detect if apc is enabled or not.
 
 Version 2.0.3
 =============