summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2011-10-17 18:19:08 +0200
committerTimothy Warren <tim@timshomepage.net>2011-10-17 18:19:08 +0200
commitd926b8fbd9e25d7c088a055cd29bbf6a93f69a8c (patch)
tree8cdc3bba85f523b4bc13e4a8ba8d915603b75049 /system/libraries
parent5600828101627a76768e4f1edbb0197d11885318 (diff)
parent3e414f9f72e387449d9e3984e1869b386564deaf (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into patch-2
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Cache/drivers/Cache_apc.php4
-rw-r--r--system/libraries/Session.php48
2 files changed, 34 insertions, 18 deletions
diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php
index de75719c4..79d91b320 100644
--- a/system/libraries/Cache/drivers/Cache_apc.php
+++ b/system/libraries/Cache/drivers/Cache_apc.php
@@ -132,7 +132,7 @@ class CI_Cache_apc extends CI_Driver {
*/
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 @@ class CI_Cache_apc extends CI_Driver {
// 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 8ee08c5b2..867314bf9 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -688,13 +688,7 @@ class CI_Session {
{
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 @@ class CI_Session {
$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 @@ class CI_Session {
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);
+ }
+ }
// --------------------------------------------------------------------