Pluf Framework

Pluf Framework Commit Details


Date:2010-05-22 10:08:16 (14 years 6 months ago)
Author:Loic d'Anterroches
Branch:develop, master
Commit:f2c18d7c0ea05d41116cd1f2e5eac0ca7bd4cf6e
Parents: 51958344844575796cdd5e3beb57ac0ea3500114
Message:Fixed a bug preventing the validation of compressed signed strings.

Changes:

File differences

src/Pluf/AB.php
171171
172172
173173
174
174
175175
176176
177177
* @param $request Pluf_HTTP_Request
* @param $props array Properties
*/
public static function register($request, $props)
public static function register(&$request, $props)
{
$pabuid = (isset($request->pabuid)) ?
$request->pabuid :
src/Pluf/Sign.php
145145
146146
147147
148
149
150
151
148152
149153
150154
151155
152
153
156
157
154158
155159
156160
if ($key === null) {
$key = Pluf::f('secret_key');
}
$compressed = ($signed_value[0] == '.') ? '.' : '';
if ($compressed) {
$signed_value = substr($signed_value, 1);
}
if (false === strpos($signed_value, '.')) {
throw new Exception('Missing signature (no . found in value).');
}
list($value, $sig) = explode('.', $signed_value, 2);
if (self::base64_hmac($value, $key) == $sig) {
return $value;
if (self::base64_hmac($compressed.$value, $key) == $sig) {
return $compressed.$value;
} else {
throw new Exception(sprintf('Signature failed: "%s".', $sig));
}

Archive Download the corresponding diff file

Branches

Tags

Number of commits:
Page rendered in 0.05801s using 13 queries.