Skip to content

Commit 640c43e

Browse files
Merge pull request #87 from julienloizelet/fix/86-session-start-and-close
Fix/86 session start and close
2 parents 09ca4f2 + 312eeab commit 640c43e

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.4.1] - 2022-04-10
8+
9+
### Fixed
10+
- Close the session after bounce process
11+
12+
713
## [1.4.0] - 2022-04-07
814

915
### Changed

crowdsec.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://github.com/crowdsecurity/cs-wordpress-bouncer
55
* Description: Safer Together. Protect your WordPress application with CrowdSec.
66
* Tags: crowdsec-bouncer, wordpress, security, firewall, captcha, ip-scanner, ip-blocker, ip-blocking, ip-address, ip-database, ip-range-check, crowdsec, ban-hosts, ban-management, anti-hacking, hacker-protection, captcha-image, captcha-generator, captcha-generation, captcha-service
7-
* Version: 1.4.0
7+
* Version: 1.4.1
88
* Author: CrowdSec
99
* Author URI: https://www.crowdsec.net/
1010
* Github: https://github.com/crowdsecurity/cs-wordpress-blocker
@@ -13,7 +13,7 @@
1313
* Requires PHP: 7.2
1414
* Requires at least: 4.9
1515
* Tested up to: 5.9
16-
* Stable tag: 1.4.0
16+
* Stable tag: 1.4.1
1717
* Text Domain: crowdsec-wp
1818
* First release: 2021.
1919
*/

inc/Bounce.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ public function safelyBounce(array $configs): bool
346346
if ($this->displayErrors) {
347347
throw $e;
348348
}
349+
} finally {
350+
if (\PHP_SESSION_NONE !== session_status()) {
351+
session_write_close();
352+
}
349353
}
350354
restore_error_handler();
351355

inc/constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ function crowdsecDefineConstants(string $crowdsecRandomLogFolder)
88
define('CROWDSEC_DEBUG_LOG_PATH', __DIR__."/../logs/$crowdsecRandomLogFolder/debug.log");
99
define('CROWDSEC_CACHE_PATH', __DIR__.'/../.cache');
1010
define('CROWDSEC_CONFIG_PATH', __DIR__.'/standalone-settings.php');
11-
define('CROWDSEC_BOUNCER_USER_AGENT', 'WordPress CrowdSec Bouncer/v1.4.0');
11+
define('CROWDSEC_BOUNCER_USER_AGENT', 'WordPress CrowdSec Bouncer/v1.4.1');
1212
}
1313
}

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://crowdsec.net/
44
Tags: crowdsec-bouncer, wordpress, security, firewall, captcha, ip-scanner, ip-blocker, ip-blocking, ip-address, ip-database, ip-range-check, crowdsec, ban-hosts, ban-management, anti-hacking, hacker-protection, captcha-image, captcha-generator, captcha-generation, captcha-service
55
Requires at least: 4.9
66
Tested up to: 5.9
7-
Stable tag: 1.4.0
7+
Stable tag: 1.4.1
88
Requires PHP: 7.2
99
License: MIT
1010
License URI: https://opensource.org/licenses/MIT

0 commit comments

Comments
 (0)