Disable mcrypt

master
parent 03f1c92979
commit 56bb3241af
  1. 12
      Http/CookieJar.php

@ -120,12 +120,12 @@ class Slim_Http_CookieJar {
$this->_ssl = $config['enable_ssl']; $this->_ssl = $config['enable_ssl'];
} }
} }
if ( extension_loaded('mcrypt') ) { /*if ( extension_loaded('mcrypt') ) {
$this->_cryptModule = @mcrypt_module_open($this->_algorithm, '', $this->_mode, ''); $this->_cryptModule = @mcrypt_module_open($this->_algorithm, '', $this->_mode, '');
if ( $this->_cryptModule === false ) { if ( $this->_cryptModule === false ) {
throw new Exception('Error while loading mcrypt module'); throw new Exception('Error while loading mcrypt module');
} }
} }*/
} }
/** /**
@ -205,7 +205,7 @@ class Slim_Http_CookieJar {
* @param bool $httponly When TRUE the cookie will be made accessible only through the HTTP protocol * @param bool $httponly When TRUE the cookie will be made accessible only through the HTTP protocol
*/ */
public function setCookie( $cookiename, $value, $username, $expire = 0, $path = '/', $domain = '', $secure = false, $httponly = null ) { public function setCookie( $cookiename, $value, $username, $expire = 0, $path = '/', $domain = '', $secure = false, $httponly = null ) {
$secureValue = extension_loaded('mcrypt') ? $this->_secureCookieValue($value, $username, $expire) : $value; $secureValue = /*extension_loaded('mcrypt') ? $this->_secureCookieValue($value, $username, $expire) : */$value;
$this->setClassicCookie($cookiename, $secureValue, $expire, $path, $domain, $secure, $httponly); $this->setClassicCookie($cookiename, $secureValue, $expire, $path, $domain, $secure, $httponly);
} }
@ -236,7 +236,7 @@ class Slim_Http_CookieJar {
*/ */
public function getCookieValue( $cookiename, $deleteIfInvalid = true ) { public function getCookieValue( $cookiename, $deleteIfInvalid = true ) {
if ( $this->cookieExists($cookiename) ) { if ( $this->cookieExists($cookiename) ) {
if ( extension_loaded('mcrypt') ) { /*if ( extension_loaded('mcrypt') ) {
$cookieValues = explode('|', $_COOKIE[$cookiename]); $cookieValues = explode('|', $_COOKIE[$cookiename]);
if ( (count($cookieValues) === 4) && ($cookieValues[1] == 0 || $cookieValues[1] >= time()) ) { if ( (count($cookieValues) === 4) && ($cookieValues[1] == 0 || $cookieValues[1] >= time()) ) {
$key = hash_hmac('sha1', $cookieValues[0] . $cookieValues[1], $this->_secret); $key = hash_hmac('sha1', $cookieValues[0] . $cookieValues[1], $this->_secret);
@ -255,9 +255,9 @@ class Slim_Http_CookieJar {
return $data; return $data;
} }
} }
} else { } else {*/
return $_COOKIE[$cookiename]; return $_COOKIE[$cookiename];
} //}
} }
if ( $deleteIfInvalid ) { if ( $deleteIfInvalid ) {
$this->deleteCookie($cookiename); $this->deleteCookie($cookiename);

Loading…
Cancel
Save