Version 1.4.10 - security hardening, empty fallback, and reCAPTCHA improvements

- Harden XSS protection with escapeHtml on all rendered output values
- Add empty_fallback support for empty cell display across all view types
- Fix reCAPTCHA default action to 'submit' matching JS side
- Move reCAPTCHA token generation from inline PHP to public.js
- Lower default reCAPTCHA min score from 0.5 to 0.3
- Improve reCAPTCHA token age check and preload error handling
- Add form submit handler for enter key support
- Increase waitForRecaptcha timeout to 10 seconds
- Show button/color settings only for button output types
- Remove debug console.log and error_log statements
- Bump version to 1.4.10
This commit is contained in:
dwindown
2026-05-28 10:29:02 +07:00
parent a2717d56d9
commit 39bb5e2331
7 changed files with 248 additions and 184 deletions

View File

@@ -127,7 +127,7 @@ class CHECKER_SECURITY {
$secret_key_raw = isset($checker['security']['recaptcha']['secret_key']) ? $checker['security']['recaptcha']['secret_key'] : '';
$secret_key = trim((string) $secret_key_raw);
$min_score_raw = isset($checker['security']['recaptcha']['min_score']) ? $checker['security']['recaptcha']['min_score'] : 0.5;
$min_score_raw = isset($checker['security']['recaptcha']['min_score']) ? $checker['security']['recaptcha']['min_score'] : 0.3;
if (is_string($min_score_raw)) {
$min_score_raw = str_replace(',', '.', $min_score_raw);
}
@@ -199,15 +199,12 @@ class CHECKER_SECURITY {
}
if ($score < $min_score) {
error_log("Sheet Data Checker: reCAPTCHA score too low - Score: {$score}, Min: {$min_score}");
return [
'success' => false,
'score' => $score,
'message' => 'reCAPTCHA score too low. Please try again.'
'message' => "reCAPTCHA score too low ({$score}). Please try again."
];
}
error_log("Sheet Data Checker: reCAPTCHA verification SUCCESS - Score: {$score}, Action: {$response_action}");
return [
'success' => true,