- Issue created by @huangweiqiu
- Merge request !114Issue #3524332: captcha_point_load($id) need to validate the $id → (Open) created by dhruv.mittal
Type php
Date Wednesday, May 14, 2025 - 03:04
User admin
Location https://nkmzs.xyz/node/add
Referrer https://nkmzs.xyz/admin/content
Message TypeError: Cannot access offset of type array on array in Drupal\Core\Entity\EntityStorageBase->load() (line 263 of /home/nkmz/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Severity Error
Hostname 2409:8a56:c51:c680:3dfa:3b70:b8f8:b55
Operations
Backtrace
#0 /home/nkmz/web/modules/contrib/captcha/captcha.module(64): Drupal\Core\Entity\EntityStorageBase->load()
#1 /home/nkmz/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(400): captcha_point_load()
#2 /home/nkmz/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Entity\EntityStorageBase->Drupal\Core\Entity\{closure}()
install hcaptcha module ,change existing captcha point to use hcaptcha
file:~ captcha.module ,then locate function captcha_point_load($id) and change it as below"~
function captcha_point_load($id) {
if (empty($id) || !is_string($id)) {
return NULL;
}
try {
return CaptchaPoint::load($id);
}
catch (\Exception $e) {
\Drupal::logger('captcha')->error('Failed to load captcha point: @error', ['@error' => $e->getMessage()]);
return NULL;
}
}
Active
2.0
Captcha API (captcha)