Created
October 23, 2012 04:11
-
-
Save joelpittet/3936591 to your computer and use it in GitHub Desktop.
Cookie minus salt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- Cookie.php | |
| +++ (clipboard) | |
| @@ -39,6 +39,11 @@ | |
| * @var boolean Only transmit cookies over HTTP, disabling Javascript access | |
| */ | |
| public static $httponly = FALSE; | |
| + | |
| + /** | |
| + * @var boolean Only turned off if the cookies need to be salted | |
| + */ | |
| + public static $needs_more_salt = FALSE; | |
| /** | |
| * Gets the value of a signed cookie. Cookies without signatures will not | |
| @@ -147,7 +152,7 @@ | |
| public static function salt($name, $value) | |
| { | |
| // Require a valid salt | |
| - if ( ! Cookie::$salt) | |
| + if ( Cookie::$needs_more_salt && ! Cookie::$salt) | |
| { | |
| throw new Kohana_Exception('A valid cookie salt is required. Please set Cookie::$salt.'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment