Skip to content

Commit 8aee17a

Browse files
committed
GET requests only
1 parent 4e59ca6 commit 8aee17a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/RedactorInjectorWidget.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ public function __construct()
2323

2424
public function run(array $params = []): ?string
2525
{
26-
// Only produce output when editing or creating a page.
27-
$route = $this->getExtension()->getRequest()->get('_route');
28-
if (! in_array($route, ['bolt_content_edit', 'bolt_content_new'], true)) {
26+
$request = $this->getExtension()->getRequest();
27+
// Only produce output when editing or creating a Record, with GET method.
28+
if (! in_array($request->get('_route'), ['bolt_content_edit', 'bolt_content_new'], true) ||
29+
($this->getExtension()->getRequest()->getMethod() !== "GET")) {
2930
return null;
3031
}
3132

0 commit comments

Comments
 (0)