Changeset 3337284
- Timestamp:
- 07/31/2025 12:53:56 PM (8 months ago)
- Location:
- captcha-eu
- Files:
-
- 4 added
- 4 deleted
- 24 edited
- 1 copied
-
tags/v1.0.59 (copied) (copied from captcha-eu/trunk)
-
tags/v1.0.59/composer.lock (modified) (4 diffs)
-
tags/v1.0.59/readme.txt (modified) (2 diffs)
-
tags/v1.0.59/src/Admin.php (modified) (17 diffs)
-
tags/v1.0.59/vendor/autoload.php (modified) (1 diff)
-
tags/v1.0.59/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/v1.0.59/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/v1.0.59/vendor/composer/installers/.git/index (modified) (previous)
-
tags/v1.0.59/vendor/composer/installers/.git/logs/HEAD (modified) (1 diff)
-
tags/v1.0.59/vendor/composer/installers/.git/logs/refs/heads/main (modified) (1 diff)
-
tags/v1.0.59/vendor/composer/installers/.git/logs/refs/remotes/origin/HEAD (modified) (1 diff)
-
tags/v1.0.59/vendor/composer/installers/.git/objects/info/packs (modified) (1 diff)
-
tags/v1.0.59/vendor/composer/installers/.git/objects/pack/pack-c8323075ac8f3d5b632c113f9a8b003d76f2ef04.idx (deleted)
-
tags/v1.0.59/vendor/composer/installers/.git/objects/pack/pack-c8323075ac8f3d5b632c113f9a8b003d76f2ef04.pack (deleted)
-
tags/v1.0.59/vendor/composer/installers/.git/objects/pack/pack-d5163848cabfa76e781dca05937c97e4aadfebf6.idx (added)
-
tags/v1.0.59/vendor/composer/installers/.git/objects/pack/pack-d5163848cabfa76e781dca05937c97e4aadfebf6.pack (added)
-
tags/v1.0.59/wp-captcha.php (modified) (1 diff)
-
trunk/composer.lock (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Admin.php (modified) (17 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installers/.git/index (modified) (previous)
-
trunk/vendor/composer/installers/.git/logs/HEAD (modified) (1 diff)
-
trunk/vendor/composer/installers/.git/logs/refs/heads/main (modified) (1 diff)
-
trunk/vendor/composer/installers/.git/logs/refs/remotes/origin/HEAD (modified) (1 diff)
-
trunk/vendor/composer/installers/.git/objects/info/packs (modified) (1 diff)
-
trunk/vendor/composer/installers/.git/objects/pack/pack-c8323075ac8f3d5b632c113f9a8b003d76f2ef04.idx (deleted)
-
trunk/vendor/composer/installers/.git/objects/pack/pack-c8323075ac8f3d5b632c113f9a8b003d76f2ef04.pack (deleted)
-
trunk/vendor/composer/installers/.git/objects/pack/pack-d5163848cabfa76e781dca05937c97e4aadfebf6.idx (added)
-
trunk/vendor/composer/installers/.git/objects/pack/pack-d5163848cabfa76e781dca05937c97e4aadfebf6.pack (added)
-
trunk/wp-captcha.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
captcha-eu/tags/v1.0.59/composer.lock
r3335262 r3337284 874 874 { 875 875 "name": "friendsofphp/php-cs-fixer", 876 "version": "v3.8 4.0",876 "version": "v3.85.1", 877 877 "source": { 878 878 "type": "git", 879 879 "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", 880 "reference": " 38dad0767bf2a9b516b976852200ae722fe984ca"881 }, 882 "dist": { 883 "type": "zip", 884 "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ 38dad0767bf2a9b516b976852200ae722fe984ca",885 "reference": " 38dad0767bf2a9b516b976852200ae722fe984ca",886 "shasum": "" 887 }, 888 "require": { 889 "clue/ndjson-react": "^1. 0",880 "reference": "2fb6d7f6c3398dca5786a1635b27405d73a417ba" 881 }, 882 "dist": { 883 "type": "zip", 884 "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/2fb6d7f6c3398dca5786a1635b27405d73a417ba", 885 "reference": "2fb6d7f6c3398dca5786a1635b27405d73a417ba", 886 "shasum": "" 887 }, 888 "require": { 889 "clue/ndjson-react": "^1.3", 890 890 "composer/semver": "^3.4", 891 891 "composer/xdebug-handler": "^3.0.5", … … 897 897 "php": "^7.4 || ^8.0", 898 898 "react/child-process": "^0.6.6", 899 "react/event-loop": "^1. 0",900 "react/promise": "^ 2.11 || ^3.0",901 "react/socket": "^1. 0",902 "react/stream": "^1. 0",899 "react/event-loop": "^1.5", 900 "react/promise": "^3.2", 901 "react/socket": "^1.16", 902 "react/stream": "^1.4", 903 903 "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0", 904 "symfony/console": "^5.4.4 5|| ^6.4.13 || ^7.0",904 "symfony/console": "^5.4.47 || ^6.4.13 || ^7.0", 905 905 "symfony/event-dispatcher": "^5.4.45 || ^6.4.13 || ^7.0", 906 906 "symfony/filesystem": "^5.4.45 || ^6.4.13 || ^7.0", … … 967 967 "support": { 968 968 "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", 969 "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.8 4.0"969 "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.85.1" 970 970 }, 971 971 "funding": [ … … 975 975 } 976 976 ], 977 "time": "2025-07- 15T18:21:57+00:00"977 "time": "2025-07-29T22:22:50+00:00" 978 978 }, 979 979 { -
captcha-eu/tags/v1.0.59/readme.txt
r3335262 r3337284 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.0 7 Stable tag: 1.0.5 87 Stable tag: 1.0.59 8 8 License: GPL 9 9 License URI: https://opensource.org/license/gpl/ … … 61 61 62 62 == Changelog == 63 = v1.0.59 = 64 * Improved JWT authentication support - added JWT bypass for all form validation methods 65 * JWT tokens are now properly detected across multiple header formats (Authorization, X-Authorization, etc.) 66 * Fixed "captcha.eu failed" errors when using REST API with JWT authentication 63 67 = v1.0.58 = 64 68 support JWT plugin -
captcha-eu/tags/v1.0.59/src/Admin.php
r3335262 r3337284 315 315 } 316 316 317 /** 318 * Check if the current request is authenticated with JWT 319 * 320 * @return bool 321 */ 322 private function isJwtAuthenticated() 323 { 324 // Check for Authorization header with Bearer token 325 if (isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) { 326 return true; 327 } 328 329 // Also check for alternative header (some servers use HTTP_AUTHORIZATION differently) 330 if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && strpos($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 'Bearer') === 0) { 331 return true; 332 } 333 334 // Check if JWT token is passed via custom header or query parameter (common in some implementations) 335 if (isset($_SERVER['HTTP_X_AUTHORIZATION']) && strpos($_SERVER['HTTP_X_AUTHORIZATION'], 'Bearer') === 0) { 336 return true; 337 } 338 339 return false; 340 } 341 317 342 public function pre_comment_on_post($comment_post_ID) 318 343 { 344 // Skip captcha validation for JWT authentication 345 if ($this->isJwtAuthenticated()) { 346 return; 347 } 348 319 349 $go_back = sprintf('<br><a href="javascript:history.go(-1)">' . __('Back to', 'captcha-eu') . ' "%s"</a>', get_the_title($comment_post_ID)); 320 350 $error = '<strong>' . __('ERROR', 'captcha-eu') . '</strong>:' . __('Captcha.eu failed to validate.', 'captcha-eu') . $go_back; … … 343 373 344 374 // Skip captcha validation for JWT authentication 345 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {375 if ($this->isJwtAuthenticated()) { 346 376 return $user; 347 377 } … … 393 423 { 394 424 // Skip captcha validation for JWT authentication 395 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {425 if ($this->isJwtAuthenticated()) { 396 426 return $allow; 397 427 } … … 422 452 return $spam; 423 453 } 454 455 // Skip captcha validation for JWT authentication 456 if ($this->isJwtAuthenticated()) { 457 return $spam; 458 } 424 459 if (! isset($_POST['captcha_at_solution'])) { 425 460 $spam = true; … … 439 474 public function wpforms_process($fields, $entry, $form_data) 440 475 { 476 // Skip captcha validation for JWT authentication 477 if ($this->isJwtAuthenticated()) { 478 return; 479 } 480 441 481 if (! isset($_POST['captcha_at_solution'])) { 442 482 wpforms()->process->errors[$form_data['id']]['footer'] = esc_html__('Captcha.eu failed', 'captcha-eu'); … … 454 494 // GFORM opt out, if CSS Class cpt_disable is added, we ignore the spam check 455 495 if (isset($form['cssClass']) && preg_match('/cpt_disable/', $form['cssClass'])) { 496 return $validation_result; 497 } 498 499 // Skip captcha validation for JWT authentication 500 if ($this->isJwtAuthenticated()) { 456 501 return $validation_result; 457 502 } … … 488 533 public function ninja_forms_submit_data($formData) 489 534 { 535 // Skip captcha validation for JWT authentication 536 if ($this->isJwtAuthenticated()) { 537 return $formData; 538 } 539 490 540 // formData not set => exit 491 541 if (! isset($formData) || empty($formData)) { … … 519 569 { 520 570 // Skip captcha validation for JWT authentication 521 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {571 if ($this->isJwtAuthenticated()) { 522 572 return $errors; 523 573 } … … 541 591 public function mc4wp_form_errors($errors, $form) 542 592 { 593 // Skip captcha validation for JWT authentication 594 if ($this->isJwtAuthenticated()) { 595 return $errors; 596 } 597 543 598 // no solution supplied 544 599 if (! isset($form->raw_data['captcha_at_solution'])) { … … 842 897 { 843 898 // Skip captcha validation for JWT authentication 844 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {899 if ($this->isJwtAuthenticated()) { 845 900 return $validation_error; 846 901 } … … 879 934 { 880 935 // Skip captcha validation for JWT authentication 881 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {936 if ($this->isJwtAuthenticated()) { 882 937 return $validation_error; 883 938 } … … 914 969 public function woocommerce_after_checkout_validation1() 915 970 { 971 // Skip captcha validation for JWT authentication 972 if ($this->isJwtAuthenticated()) { 973 return; 974 } 975 916 976 $errmsg = __('Captcha.eu failed', 'captcha-eu'); 917 977 if (! isset($_POST['captcha_at_solution'])) { … … 932 992 public function woocommerce_after_checkout_validation($fields, $errors) 933 993 { 994 // Skip captcha validation for JWT authentication 995 if ($this->isJwtAuthenticated()) { 996 return; 997 } 998 934 999 if (! isset($_POST['captcha_at_solution'])) { 935 1000 // no solution supplied … … 949 1014 public function elementor_pro_forms_validation($record, $ajax_handler) 950 1015 { 1016 // Skip captcha validation for JWT authentication 1017 if ($this->isJwtAuthenticated()) { 1018 return; 1019 } 1020 951 1021 $msgErr = __('Captcha.eu failed', 'captcha-eu'); 952 1022 … … 971 1041 public function et_pb_contact_form_submit($processed_fields_values, $et_contact_error, $contact_form_info) 972 1042 { 1043 // Skip captcha validation for JWT authentication 1044 if ($this->isJwtAuthenticated()) { 1045 return; 1046 } 1047 973 1048 if (! isset($_POST['captcha_at_solution'])) { 974 1049 echo __('Captcha.eu failed', 'captcha-eu'); … … 1123 1198 return; 1124 1199 } 1200 1201 // Skip captcha validation for JWT authentication 1202 if ($this->isJwtAuthenticated()) { 1203 return; 1204 } 1205 1125 1206 $error_message = 'captcha.eu failed'; 1126 1207 // Get Captcha and Validate it … … 1234 1315 public function forminator_validate($can_show, $id, $form_settings) 1235 1316 { 1317 // Skip captcha validation for JWT authentication 1318 if ($this->isJwtAuthenticated()) { 1319 return $can_show; 1320 } 1321 1236 1322 $msgErr = __('Captcha.eu failed', 'captcha-eu'); 1237 1323 -
captcha-eu/tags/v1.0.59/vendor/autoload.php
r3335262 r3337284 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit dc49d90a99d6b80090c22aa0943d4ae8::getLoader();25 return ComposerAutoloaderInit99be33d805d50fbd8c777a85e6de3135::getLoader(); -
captcha-eu/tags/v1.0.59/vendor/composer/autoload_real.php
r3335262 r3337284 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit dc49d90a99d6b80090c22aa0943d4ae85 class ComposerAutoloaderInit99be33d805d50fbd8c777a85e6de3135 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit dc49d90a99d6b80090c22aa0943d4ae8', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit99be33d805d50fbd8c777a85e6de3135', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit dc49d90a99d6b80090c22aa0943d4ae8', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit99be33d805d50fbd8c777a85e6de3135', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae8::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit99be33d805d50fbd8c777a85e6de3135::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
captcha-eu/tags/v1.0.59/vendor/composer/autoload_static.php
r3335262 r3337284 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae87 class ComposerStaticInit99be33d805d50fbd8c777a85e6de3135 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 34 34 { 35 35 return \Closure::bind(function () use ($loader) { 36 $loader->prefixLengthsPsr4 = ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae8::$prefixLengthsPsr4;37 $loader->prefixDirsPsr4 = ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae8::$prefixDirsPsr4;38 $loader->classMap = ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae8::$classMap;36 $loader->prefixLengthsPsr4 = ComposerStaticInit99be33d805d50fbd8c777a85e6de3135::$prefixLengthsPsr4; 37 $loader->prefixDirsPsr4 = ComposerStaticInit99be33d805d50fbd8c777a85e6de3135::$prefixDirsPsr4; 38 $loader->classMap = ComposerStaticInit99be33d805d50fbd8c777a85e6de3135::$classMap; 39 39 40 40 }, null, ClassLoader::class); -
captcha-eu/tags/v1.0.59/vendor/composer/installers/.git/logs/HEAD
r3335262 r3337284 1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753 697466+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/2 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 d20a64ed3c94748397ff5973488761b22f6d3f19 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753 697466+0000 checkout: moving from main to v1.12.01 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753966414 +0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/ 2 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 d20a64ed3c94748397ff5973488761b22f6d3f19 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753966414 +0000 checkout: moving from main to v1.12.0 -
captcha-eu/tags/v1.0.59/vendor/composer/installers/.git/logs/refs/heads/main
r3335262 r3337284 1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753 697466+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753966414 +0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/ -
captcha-eu/tags/v1.0.59/vendor/composer/installers/.git/logs/refs/remotes/origin/HEAD
r3335262 r3337284 1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753 697466+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753966414 +0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/ -
captcha-eu/tags/v1.0.59/vendor/composer/installers/.git/objects/info/packs
r3335262 r3337284 1 P pack- c8323075ac8f3d5b632c113f9a8b003d76f2ef04.pack1 P pack-d5163848cabfa76e781dca05937c97e4aadfebf6.pack 2 2 -
captcha-eu/tags/v1.0.59/wp-captcha.php
r3335262 r3337284 4 4 * Description: Captcha.eu provides a GDPR compliant protection against bots and spammers. 5 5 * Plugin URI: https://www.captcha.eu 6 * Version: 1.0.5 86 * Version: 1.0.59 7 7 * Author: captchaeu 8 8 * Author URI: https://profiles.wordpress.org/captchaeu/ -
captcha-eu/trunk/composer.lock
r3335262 r3337284 874 874 { 875 875 "name": "friendsofphp/php-cs-fixer", 876 "version": "v3.8 4.0",876 "version": "v3.85.1", 877 877 "source": { 878 878 "type": "git", 879 879 "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", 880 "reference": " 38dad0767bf2a9b516b976852200ae722fe984ca"881 }, 882 "dist": { 883 "type": "zip", 884 "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ 38dad0767bf2a9b516b976852200ae722fe984ca",885 "reference": " 38dad0767bf2a9b516b976852200ae722fe984ca",886 "shasum": "" 887 }, 888 "require": { 889 "clue/ndjson-react": "^1. 0",880 "reference": "2fb6d7f6c3398dca5786a1635b27405d73a417ba" 881 }, 882 "dist": { 883 "type": "zip", 884 "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/2fb6d7f6c3398dca5786a1635b27405d73a417ba", 885 "reference": "2fb6d7f6c3398dca5786a1635b27405d73a417ba", 886 "shasum": "" 887 }, 888 "require": { 889 "clue/ndjson-react": "^1.3", 890 890 "composer/semver": "^3.4", 891 891 "composer/xdebug-handler": "^3.0.5", … … 897 897 "php": "^7.4 || ^8.0", 898 898 "react/child-process": "^0.6.6", 899 "react/event-loop": "^1. 0",900 "react/promise": "^ 2.11 || ^3.0",901 "react/socket": "^1. 0",902 "react/stream": "^1. 0",899 "react/event-loop": "^1.5", 900 "react/promise": "^3.2", 901 "react/socket": "^1.16", 902 "react/stream": "^1.4", 903 903 "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0", 904 "symfony/console": "^5.4.4 5|| ^6.4.13 || ^7.0",904 "symfony/console": "^5.4.47 || ^6.4.13 || ^7.0", 905 905 "symfony/event-dispatcher": "^5.4.45 || ^6.4.13 || ^7.0", 906 906 "symfony/filesystem": "^5.4.45 || ^6.4.13 || ^7.0", … … 967 967 "support": { 968 968 "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", 969 "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.8 4.0"969 "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.85.1" 970 970 }, 971 971 "funding": [ … … 975 975 } 976 976 ], 977 "time": "2025-07- 15T18:21:57+00:00"977 "time": "2025-07-29T22:22:50+00:00" 978 978 }, 979 979 { -
captcha-eu/trunk/readme.txt
r3335262 r3337284 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.0 7 Stable tag: 1.0.5 87 Stable tag: 1.0.59 8 8 License: GPL 9 9 License URI: https://opensource.org/license/gpl/ … … 61 61 62 62 == Changelog == 63 = v1.0.59 = 64 * Improved JWT authentication support - added JWT bypass for all form validation methods 65 * JWT tokens are now properly detected across multiple header formats (Authorization, X-Authorization, etc.) 66 * Fixed "captcha.eu failed" errors when using REST API with JWT authentication 63 67 = v1.0.58 = 64 68 support JWT plugin -
captcha-eu/trunk/src/Admin.php
r3335262 r3337284 315 315 } 316 316 317 /** 318 * Check if the current request is authenticated with JWT 319 * 320 * @return bool 321 */ 322 private function isJwtAuthenticated() 323 { 324 // Check for Authorization header with Bearer token 325 if (isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) { 326 return true; 327 } 328 329 // Also check for alternative header (some servers use HTTP_AUTHORIZATION differently) 330 if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && strpos($_SERVER['REDIRECT_HTTP_AUTHORIZATION'], 'Bearer') === 0) { 331 return true; 332 } 333 334 // Check if JWT token is passed via custom header or query parameter (common in some implementations) 335 if (isset($_SERVER['HTTP_X_AUTHORIZATION']) && strpos($_SERVER['HTTP_X_AUTHORIZATION'], 'Bearer') === 0) { 336 return true; 337 } 338 339 return false; 340 } 341 317 342 public function pre_comment_on_post($comment_post_ID) 318 343 { 344 // Skip captcha validation for JWT authentication 345 if ($this->isJwtAuthenticated()) { 346 return; 347 } 348 319 349 $go_back = sprintf('<br><a href="javascript:history.go(-1)">' . __('Back to', 'captcha-eu') . ' "%s"</a>', get_the_title($comment_post_ID)); 320 350 $error = '<strong>' . __('ERROR', 'captcha-eu') . '</strong>:' . __('Captcha.eu failed to validate.', 'captcha-eu') . $go_back; … … 343 373 344 374 // Skip captcha validation for JWT authentication 345 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {375 if ($this->isJwtAuthenticated()) { 346 376 return $user; 347 377 } … … 393 423 { 394 424 // Skip captcha validation for JWT authentication 395 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {425 if ($this->isJwtAuthenticated()) { 396 426 return $allow; 397 427 } … … 422 452 return $spam; 423 453 } 454 455 // Skip captcha validation for JWT authentication 456 if ($this->isJwtAuthenticated()) { 457 return $spam; 458 } 424 459 if (! isset($_POST['captcha_at_solution'])) { 425 460 $spam = true; … … 439 474 public function wpforms_process($fields, $entry, $form_data) 440 475 { 476 // Skip captcha validation for JWT authentication 477 if ($this->isJwtAuthenticated()) { 478 return; 479 } 480 441 481 if (! isset($_POST['captcha_at_solution'])) { 442 482 wpforms()->process->errors[$form_data['id']]['footer'] = esc_html__('Captcha.eu failed', 'captcha-eu'); … … 454 494 // GFORM opt out, if CSS Class cpt_disable is added, we ignore the spam check 455 495 if (isset($form['cssClass']) && preg_match('/cpt_disable/', $form['cssClass'])) { 496 return $validation_result; 497 } 498 499 // Skip captcha validation for JWT authentication 500 if ($this->isJwtAuthenticated()) { 456 501 return $validation_result; 457 502 } … … 488 533 public function ninja_forms_submit_data($formData) 489 534 { 535 // Skip captcha validation for JWT authentication 536 if ($this->isJwtAuthenticated()) { 537 return $formData; 538 } 539 490 540 // formData not set => exit 491 541 if (! isset($formData) || empty($formData)) { … … 519 569 { 520 570 // Skip captcha validation for JWT authentication 521 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {571 if ($this->isJwtAuthenticated()) { 522 572 return $errors; 523 573 } … … 541 591 public function mc4wp_form_errors($errors, $form) 542 592 { 593 // Skip captcha validation for JWT authentication 594 if ($this->isJwtAuthenticated()) { 595 return $errors; 596 } 597 543 598 // no solution supplied 544 599 if (! isset($form->raw_data['captcha_at_solution'])) { … … 842 897 { 843 898 // Skip captcha validation for JWT authentication 844 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {899 if ($this->isJwtAuthenticated()) { 845 900 return $validation_error; 846 901 } … … 879 934 { 880 935 // Skip captcha validation for JWT authentication 881 if ( isset($_SERVER['HTTP_AUTHORIZATION']) && strpos($_SERVER['HTTP_AUTHORIZATION'], 'Bearer') === 0) {936 if ($this->isJwtAuthenticated()) { 882 937 return $validation_error; 883 938 } … … 914 969 public function woocommerce_after_checkout_validation1() 915 970 { 971 // Skip captcha validation for JWT authentication 972 if ($this->isJwtAuthenticated()) { 973 return; 974 } 975 916 976 $errmsg = __('Captcha.eu failed', 'captcha-eu'); 917 977 if (! isset($_POST['captcha_at_solution'])) { … … 932 992 public function woocommerce_after_checkout_validation($fields, $errors) 933 993 { 994 // Skip captcha validation for JWT authentication 995 if ($this->isJwtAuthenticated()) { 996 return; 997 } 998 934 999 if (! isset($_POST['captcha_at_solution'])) { 935 1000 // no solution supplied … … 949 1014 public function elementor_pro_forms_validation($record, $ajax_handler) 950 1015 { 1016 // Skip captcha validation for JWT authentication 1017 if ($this->isJwtAuthenticated()) { 1018 return; 1019 } 1020 951 1021 $msgErr = __('Captcha.eu failed', 'captcha-eu'); 952 1022 … … 971 1041 public function et_pb_contact_form_submit($processed_fields_values, $et_contact_error, $contact_form_info) 972 1042 { 1043 // Skip captcha validation for JWT authentication 1044 if ($this->isJwtAuthenticated()) { 1045 return; 1046 } 1047 973 1048 if (! isset($_POST['captcha_at_solution'])) { 974 1049 echo __('Captcha.eu failed', 'captcha-eu'); … … 1123 1198 return; 1124 1199 } 1200 1201 // Skip captcha validation for JWT authentication 1202 if ($this->isJwtAuthenticated()) { 1203 return; 1204 } 1205 1125 1206 $error_message = 'captcha.eu failed'; 1126 1207 // Get Captcha and Validate it … … 1234 1315 public function forminator_validate($can_show, $id, $form_settings) 1235 1316 { 1317 // Skip captcha validation for JWT authentication 1318 if ($this->isJwtAuthenticated()) { 1319 return $can_show; 1320 } 1321 1236 1322 $msgErr = __('Captcha.eu failed', 'captcha-eu'); 1237 1323 -
captcha-eu/trunk/vendor/autoload.php
r3335262 r3337284 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit dc49d90a99d6b80090c22aa0943d4ae8::getLoader();25 return ComposerAutoloaderInit99be33d805d50fbd8c777a85e6de3135::getLoader(); -
captcha-eu/trunk/vendor/composer/autoload_real.php
r3335262 r3337284 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit dc49d90a99d6b80090c22aa0943d4ae85 class ComposerAutoloaderInit99be33d805d50fbd8c777a85e6de3135 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit dc49d90a99d6b80090c22aa0943d4ae8', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit99be33d805d50fbd8c777a85e6de3135', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit dc49d90a99d6b80090c22aa0943d4ae8', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit99be33d805d50fbd8c777a85e6de3135', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae8::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit99be33d805d50fbd8c777a85e6de3135::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
captcha-eu/trunk/vendor/composer/autoload_static.php
r3335262 r3337284 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae87 class ComposerStaticInit99be33d805d50fbd8c777a85e6de3135 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 34 34 { 35 35 return \Closure::bind(function () use ($loader) { 36 $loader->prefixLengthsPsr4 = ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae8::$prefixLengthsPsr4;37 $loader->prefixDirsPsr4 = ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae8::$prefixDirsPsr4;38 $loader->classMap = ComposerStaticInit dc49d90a99d6b80090c22aa0943d4ae8::$classMap;36 $loader->prefixLengthsPsr4 = ComposerStaticInit99be33d805d50fbd8c777a85e6de3135::$prefixLengthsPsr4; 37 $loader->prefixDirsPsr4 = ComposerStaticInit99be33d805d50fbd8c777a85e6de3135::$prefixDirsPsr4; 38 $loader->classMap = ComposerStaticInit99be33d805d50fbd8c777a85e6de3135::$classMap; 39 39 40 40 }, null, ClassLoader::class); -
captcha-eu/trunk/vendor/composer/installers/.git/logs/HEAD
r3335262 r3337284 1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753 697466+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/2 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 d20a64ed3c94748397ff5973488761b22f6d3f19 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753 697466+0000 checkout: moving from main to v1.12.01 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753966414 +0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/ 2 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 d20a64ed3c94748397ff5973488761b22f6d3f19 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753966414 +0000 checkout: moving from main to v1.12.0 -
captcha-eu/trunk/vendor/composer/installers/.git/logs/refs/heads/main
r3335262 r3337284 1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753 697466+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753966414 +0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/ -
captcha-eu/trunk/vendor/composer/installers/.git/logs/refs/remotes/origin/HEAD
r3335262 r3337284 1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753 697466+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/1 0000000000000000000000000000000000000000 5b390889ecbb17bfa69ed5a030fa2e6075a19ba0 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1753966414 +0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/ -
captcha-eu/trunk/vendor/composer/installers/.git/objects/info/packs
r3335262 r3337284 1 P pack- c8323075ac8f3d5b632c113f9a8b003d76f2ef04.pack1 P pack-d5163848cabfa76e781dca05937c97e4aadfebf6.pack 2 2 -
captcha-eu/trunk/wp-captcha.php
r3335262 r3337284 4 4 * Description: Captcha.eu provides a GDPR compliant protection against bots and spammers. 5 5 * Plugin URI: https://www.captcha.eu 6 * Version: 1.0.5 86 * Version: 1.0.59 7 7 * Author: captchaeu 8 8 * Author URI: https://profiles.wordpress.org/captchaeu/
Note: See TracChangeset
for help on using the changeset viewer.