diff --git a/src/Pluf/Middleware/Session.php b/src/Pluf/Middleware/Session.php index 8636b41..8d3fb54 100644 --- a/src/Pluf/Middleware/Session.php +++ b/src/Pluf/Middleware/Session.php @@ -58,7 +58,7 @@ class Pluf_Middleware_Session return false; } try { - $data = $this->_decodeData($request->COOKIE[$session->cookie_name]); + $data = self::_decodeData($request->COOKIE[$session->cookie_name]); } catch (Exception $e) { $request->user = $user; $request->session = $session; @@ -126,7 +126,7 @@ class Pluf_Middleware_Session $data[$request->user->session_key] = $request->user->id; } $data['Pluf_Session_key'] = $request->session->session_key; - $response->cookies[$request->session->cookie_name] = $this->_encodeData($data); + $response->cookies[$request->session->cookie_name] = self::_encodeData($data); } if ($request->session->set_test_cookie != null) { $response->cookies[$request->session->test_cookie_name] = $request->session->test_cookie_value; @@ -140,7 +140,7 @@ class Pluf_Middleware_Session * @param mixed Data to encode * @return string Encoded data ready for the cookie */ - function _encodeData($data) + public static function _encodeData($data) { if ('' == ($key = Pluf::f('secret_key'))) { throw new Exception('Security error: "secret_key" is not set in the configuration file.'); @@ -157,7 +157,7 @@ class Pluf_Middleware_Session * @param string Encoded data * @return mixed Decoded data */ - function _decodeData($encoded_data) + public static function _decodeData($encoded_data) { $check = substr($encoded_data, -32); $base64_data = substr($encoded_data, 0, strlen($encoded_data)-32); diff --git a/src/Pluf/Middleware/Tidy.php b/src/Pluf/Middleware/Tidy.php index 3bb86ba..eec9a6a 100644 --- a/src/Pluf/Middleware/Tidy.php +++ b/src/Pluf/Middleware/Tidy.php @@ -53,7 +53,7 @@ class Pluf_Middleware_Tidy return $response; } $ok = false; - $cts = array('text/html', 'text/html', 'application/xhtml+xml'); + $cts = array('text/html', 'application/xhtml+xml'); foreach ($cts as $ct) { if (false !== strripos($response->headers['Content-Type'], $ct)) { $ok = true;