git-svn-id: https://msi/svn/firstRepo/Service/branches/Manut_2.2.3@41 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Josh Lockhart
|
||||
* @link http://www.slimframework.com
|
||||
* @license http://www.slimframework.com/license
|
||||
* @version 2.4.2
|
||||
* @version 2.6.1
|
||||
* @package Slim
|
||||
*
|
||||
* MIT LICENSE
|
||||
@@ -116,7 +116,7 @@ class ContentTypes extends \Slim\Middleware
|
||||
{
|
||||
if (function_exists('json_decode')) {
|
||||
$result = json_decode($input, true);
|
||||
if ($result) {
|
||||
if(json_last_error() === JSON_ERROR_NONE) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Josh Lockhart
|
||||
* @link http://www.slimframework.com
|
||||
* @license http://www.slimframework.com/license
|
||||
* @version 2.4.2
|
||||
* @version 2.6.1
|
||||
* @package Slim
|
||||
*
|
||||
* MIT LICENSE
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Josh Lockhart
|
||||
* @link http://www.slimframework.com
|
||||
* @license http://www.slimframework.com/license
|
||||
* @version 2.4.2
|
||||
* @version 2.6.1
|
||||
* @package Slim
|
||||
*
|
||||
* MIT LICENSE
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Josh Lockhart
|
||||
* @link http://www.slimframework.com
|
||||
* @license http://www.slimframework.com/license
|
||||
* @version 2.4.2
|
||||
* @version 2.6.1
|
||||
* @package Slim
|
||||
*
|
||||
* MIT LICENSE
|
||||
@@ -89,7 +89,7 @@ class PrettyExceptions extends \Slim\Middleware
|
||||
$message = $exception->getMessage();
|
||||
$file = $exception->getFile();
|
||||
$line = $exception->getLine();
|
||||
$trace = str_replace(array('#', '\n'), array('<div>#', '</div>'), $exception->getTraceAsString());
|
||||
$trace = str_replace(array('#', "\n"), array('<div>#', '</div>'), $exception->getTraceAsString());
|
||||
$html = sprintf('<h1>%s</h1>', $title);
|
||||
$html .= '<p>The application could not run because of the following error:</p>';
|
||||
$html .= '<h2>Details</h2>';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @copyright 2011 Josh Lockhart
|
||||
* @link http://www.slimframework.com
|
||||
* @license http://www.slimframework.com/license
|
||||
* @version 2.4.2
|
||||
* @version 2.6.1
|
||||
* @package Slim
|
||||
*
|
||||
* MIT LICENSE
|
||||
@@ -119,15 +119,10 @@ class SessionCookie extends \Slim\Middleware
|
||||
if (session_id() === '') {
|
||||
session_start();
|
||||
}
|
||||
|
||||
$value = $this->app->getCookie($this->settings['name']);
|
||||
|
||||
if ($value) {
|
||||
try {
|
||||
$_SESSION = unserialize($value);
|
||||
} catch (\Exception $e) {
|
||||
$this->app->getLog()->error('Error unserializing session cookie value! ' . $e->getMessage());
|
||||
}
|
||||
$value = json_decode($value, true);
|
||||
$_SESSION = is_array($value) ? $value : array();
|
||||
} else {
|
||||
$_SESSION = array();
|
||||
}
|
||||
@@ -138,7 +133,7 @@ class SessionCookie extends \Slim\Middleware
|
||||
*/
|
||||
protected function saveSession()
|
||||
{
|
||||
$value = serialize($_SESSION);
|
||||
$value = json_encode($_SESSION);
|
||||
|
||||
if (strlen($value) > 4096) {
|
||||
$this->app->getLog()->error('WARNING! Slim\Middleware\SessionCookie data size is larger than 4KB. Content save failed.');
|
||||
|
||||
Reference in New Issue
Block a user