Skip to content

Commit 8ff5928

Browse files
committed
fix csrf / spam error
1 parent df4e1ee commit 8ff5928

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

help.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22
$readmePath = rex_path::addon('d2u_guestbook', 'README.md');
33
$readmeContent = rex_file::get($readmePath);
4-
$readmeHtml = rex_markdown::factory()->parse($readmeContent);
5-
echo $readmeHtml;
4+
if(null !== $readmeContent) {
5+
echo rex_markdown::factory()->parse($readmeContent);
6+
}

install.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
$modules = [];
2626
$modules[] = new D2UModule('60-1',
2727
'D2U Guestbook - Gästebuch mit Bootstrap 4 Tabs',
28-
14);
28+
15);
2929
$modules[] = new D2UModule('60-2',
3030
'D2U Guestbook - Infobox Bewertung',
3131
4);
3232
$modules[] = new D2UModule('60-3',
3333
'D2U Guestbook - Gästebuch ohne Tabs',
34-
11);
34+
12);
3535
$d2u_module_manager = new D2UModuleManager($modules, '', 'd2u_guestbook');
3636
$d2u_module_manager->autoupdate();
3737
}

lib/d2u_guestbook_module_manager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public static function getModules()
1515
$modules = [];
1616
$modules[] = new D2UModule('60-1',
1717
'D2U Guestbook - Gästebuch mit Bootstrap 4 Tabs',
18-
14);
18+
15);
1919
$modules[] = new D2UModule('60-2',
2020
'D2U Guestbook - Infobox Bewertung',
2121
4);
2222
$modules[] = new D2UModule('60-3',
2323
'D2U Guestbook - Gästebuch ohne Tabs',
24-
11);
24+
12);
2525
return $modules;
2626
}
2727
}

modules/60/1/output.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,10 @@ function d2u_guestbook_module_60_1_click_stars(wert) {
192192

193193
$yform = new rex_yform();
194194
$yform->setFormData(trim($form_data));
195-
$yform->setObjectparams('csrf_protection', false);
196195
$yform->setObjectparams('Error-occured', $tag_open .'d2u_guestbook_form_validate_title'. $tag_close);
197196
$yform->setObjectparams('form_action', rex_getUrl(rex_article::getCurrentId()));
198197
$yform->setObjectparams('form_anchor', 'tab_write');
199-
$yform->setObjectparams('form_name', 'd2u_guestbook_module_60_1_'. random_int(1, 100));
198+
$yform->setObjectparams('form_name', 'd2u_guestbook_module_60_1_'. $this->getCurrentSlice()->getId()); /** @phpstan-ignore-line */
200199
$yform->setObjectparams('real_field_names', true);
201200

202201
// action - showtext

modules/60/3/output.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ function d2u_guestbook_module_60_3_click_stars(wert) {
7979

8080
$yform = new rex_yform();
8181
$yform->setFormData(trim($form_data));
82-
$yform->setObjectparams('csrf_protection', false);
8382
$yform->setObjectparams('Error-occured', $tag_open .'d2u_guestbook_form_validate_title'. $tag_close);
8483
$yform->setObjectparams('form_action', rex_getUrl(rex_article::getCurrentId(), null, ['entry' => 'add']));
85-
$yform->setObjectparams('form_name', 'd2u_guestbook_module_60_3_'. random_int(1, 100));
84+
$yform->setObjectparams('form_name', 'd2u_guestbook_module_60_3_'. $this->getCurrentSlice()->getId()); /** @phpstan-ignore-line */
8685
$yform->setObjectparams('real_field_names', true);
8786

8887
// action - showtext

pages/setup.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@
5757
<h2>Support</h2>
5858
<p>Fehlermeldungen bitte im <a href="https://github.com/TobiasKrais/d2u_guestbook" target="_blank">GitHub Repository</a> melden.</p>
5959
<h2>Changelog</h2>
60-
<p>1.0.12-DEV:</p>
60+
<p>1.0.12:</p>
6161
<ul>
62-
<li>...</li>
62+
<li>Modul "60-1 D2U Guestbook - Gästebuch mit Bootstrap 4 Tabs": Fehler im Spamschutz und CSRF Schutz behoben.</li>
63+
<li>Modul "60-3 D2U Guestbook - Gästebuch ohne Tabs": Fehler im Spamschutz und CSRF Schutz behoben.</li>
6364
</ul>
6465
<p>1.0.11:</p>
6566
<ul>

0 commit comments

Comments
 (0)