You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: inc/admin/advanced-settings.php
+11-8Lines changed: 11 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ function adminAdvancedSettings()
24
24
$bouncer->clearCache();
25
25
$refresh = $bouncer->refreshBlocklistCache();
26
26
$result = $refresh['new']??0;
27
-
$message = __('As the stream mode is enabled, the cache has just been refreshed, '.($result > 0 ? 'there are now '.$result.' decisions' : 'there is now '.$result.' decision').' in cache.');
27
+
$message = __('As the stream mode is enabled, the cache has just been refreshed, '.($result > 1 ? 'there are now '.$result.' decisions' : 'there is now '.$result.' decision').' in cache.');
28
28
AdminNotice::displaySuccess($message);
29
29
scheduleBlocklistRefresh();
30
30
}, function () {
@@ -55,8 +55,10 @@ function adminAdvancedSettings()
55
55
$bouncer->clearCache();
56
56
$refresh = $bouncer->refreshBlocklistCache();
57
57
$result = $refresh['new']??0;
58
-
$message = __('As the stream mode refresh duration changed, the cache has just been refreshed, '.($result >
59
-
0 ? 'there are now '.$result.' decisions' : 'there is now '.$result.' decision').' in cache.');
58
+
$message = __('As the stream mode refresh duration changed, the cache has just been refreshed, ' .
59
+
($result > 1 ? 'there are now '.$result.' decisions' : 'there is now '.$result.' decision')
60
+
. ' in cache.'
61
+
);
60
62
AdminNotice::displaySuccess($message);
61
63
scheduleBlocklistRefresh();
62
64
}
@@ -166,9 +168,10 @@ function adminAdvancedSettings()
166
168
try {
167
169
if (get_option('crowdsec_stream_mode') && !$error) {
168
170
// system
171
+
$bouncer->clearCache();
169
172
$result = $bouncer->refreshBlocklistCache();
170
173
$count = $result['new'];
171
-
$message .= __('As the stream mode is enabled, the cache has just been refreshed, '.($count > 0 ? 'there are now '.$count.' decisions' : 'there is now '.$count.' decision').' in cache.');
174
+
$message .= __('As the stream mode is enabled, the cache has just been refreshed, '.($count > 1 ? 'there are now '.$count.' decisions' : 'there is now '.$count.' decision').' in cache.');
172
175
AdminNotice::displaySuccess($message);
173
176
scheduleBlocklistRefresh();
174
177
}
@@ -281,7 +284,7 @@ function convertInlineIpRangesToComparableIpBounds(string $inlineIpRanges): arra
add_settings_error('Trust these CDN IPs', 'crowdsec_error', 'Trust these CDN IPs: Invalid IP List format.');
@@ -363,11 +366,11 @@ function convertInlineIpRangesToComparableIpBounds(string $inlineIpRanges): arra
363
366
364
367
// Field "crowdsec_debug_mode"
365
368
addFieldCheckbox('crowdsec_debug_mode', 'Enable debug mode', 'crowdsec_plugin_advanced_settings', 'crowdsec_advanced_settings', 'crowdsec_admin_advanced_debug', function () {}, function () {}, '
366
-
<p>Should not be used in production.<br>When this mode is enabled, a debug.log file will be written in the <i>wp-content/plugins/crowdsec/logs</i> folder.</p>');
369
+
<p>Should not be used in production.<br>When this mode is enabled, a <i>debug.log</i> file will be written in the <i>wp-content/plugins/crowdsec/logs</i> folder.</p>');
367
370
368
371
// Field "crowdsec_disable_prod_log"
369
372
addFieldCheckbox('crowdsec_disable_prod_log', 'Disable prod log', 'crowdsec_plugin_advanced_settings', 'crowdsec_advanced_settings', 'crowdsec_admin_advanced_debug', function () {}, function () {}, '
370
-
<p>By default, a prod.log file will be written in the <i>wp-content/plugins/crowdsec/logs</i> folder.<br>You can disable this log here.</p>');
373
+
<p>By default, a <i>prod.log</i> file will be written in the <i>wp-content/plugins/crowdsec/logs</i> folder.<br>You can disable this log here.</p>');
371
374
372
375
/*******************************
373
376
** Section "Display errors" **
@@ -379,7 +382,7 @@ function convertInlineIpRangesToComparableIpBounds(string $inlineIpRanges): arra
379
382
380
383
// Field "crowdsec_display_errors"
381
384
addFieldCheckbox('crowdsec_display_errors', 'Enable errors display', 'crowdsec_plugin_advanced_settings', 'crowdsec_advanced_settings', 'crowdsec_admin_advanced_display_errors', function () {}, function () {}, '
382
-
<p>Do not use in production. When this mode is enabled, you will see every unexpected bouncing errors in the browser.</p>');
385
+
<p><strong>Do not use in production.</strong> When this mode is enabled, you will see every unexpected bouncing errors in the browser.</p>');
Copy file name to clipboardExpand all lines: inc/admin/init.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ function clearBouncerCacheInAdminPage()
46
46
if (get_option('crowdsec_stream_mode')) {
47
47
$refresh = $bouncer->refreshBlocklistCache();
48
48
$result = $refresh['new']??0;
49
-
$message .= __(' As the stream mode is enabled, the cache has just been refreshed, '.($result > 0 ? 'there are now '.$result.' decisions' : 'there is now '.$result.' decision').' in cache.');
49
+
$message .= __(' As the stream mode is enabled, the cache has just been refreshed, '.($result > 1 ? 'there are now '.$result.' decisions' : 'there is now '.$result.' decision').' in cache.');
0 commit comments