Skip to content

Commit f083e9b

Browse files
committed
minor enhancements: bug fixes
1 parent 5e905d7 commit f083e9b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

js/csrfprotector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function csrfprotector_init() {
261261
if (data !== null && typeof data === 'object') {
262262
data.append(CSRFP.CSRFP_TOKEN, CSRFP._getAuthKey());
263263
} else {
264-
if (data !== "") {
264+
if (typeof data != "undefined") {
265265
data += "&";
266266
} else {
267267
data = "";

libs/csrf/csrfprotector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ public static function init($length = null, $action = null)
137137

138138
if (!isset($_COOKIE[self::$config['CSRFP_TOKEN']])
139139
|| !isset($_SESSION[self::$config['CSRFP_TOKEN']])
140-
|| !is_array($_SESSION[self::$config['CSRFP_TOKEN']]))
140+
|| !is_array($_SESSION[self::$config['CSRFP_TOKEN']])
141+
|| !in_array($_COOKIE[self::$config['CSRFP_TOKEN']],
142+
$_SESSION[self::$config['CSRFP_TOKEN']]))
141143
self::refreshToken();
142144

143145
// Set protected by CSRF Protector header

0 commit comments

Comments
 (0)