Drupal Forward Module durch (Re)Captcha schützen - sonst Spam ohne Ende über "forward-form-node-123" oder "forward-form-comment-123"

Drupal's Forward Module hat ein Nachteil: jedes Form hat eine numerische eindeutige ID, was unmöglich macht Formulare mit Captcha / Recaptcha zu schützen.

 

zB:

  •  forward-form-node-12345 (statt  forward-form-node)
  •  forward-form-comment-12345  (statt  forward-form-comment)

Deswegen ist ein Patch nötig.

Die Lösung

File:Line

modules\contrib\forward\src\Form\ForwardForm.php:187



 

  public function getFormId() {
       return 'forward_form_' . $this->entity->getEntityTypeId() . '_' . $this->entity->id();
  }

ersetzen durch:

  public function getFormId() {
    return 'forward_form_' . $this->entity->getEntityTypeId() ;
  }

 

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare