Skip to content

Commit

Permalink
fix csrf / spam error
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasKrais committed May 22, 2023
1 parent df4e1ee commit 8ff5928
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
5 changes: 3 additions & 2 deletions help.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
$readmePath = rex_path::addon('d2u_guestbook', 'README.md');
$readmeContent = rex_file::get($readmePath);
$readmeHtml = rex_markdown::factory()->parse($readmeContent);
echo $readmeHtml;
if(null !== $readmeContent) {
echo rex_markdown::factory()->parse($readmeContent);
}
4 changes: 2 additions & 2 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
$modules = [];
$modules[] = new D2UModule('60-1',
'D2U Guestbook - Gästebuch mit Bootstrap 4 Tabs',
14);
15);
$modules[] = new D2UModule('60-2',
'D2U Guestbook - Infobox Bewertung',
4);
$modules[] = new D2UModule('60-3',
'D2U Guestbook - Gästebuch ohne Tabs',
11);
12);
$d2u_module_manager = new D2UModuleManager($modules, '', 'd2u_guestbook');
$d2u_module_manager->autoupdate();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/d2u_guestbook_module_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ public static function getModules()
$modules = [];
$modules[] = new D2UModule('60-1',
'D2U Guestbook - Gästebuch mit Bootstrap 4 Tabs',
14);
15);
$modules[] = new D2UModule('60-2',
'D2U Guestbook - Infobox Bewertung',
4);
$modules[] = new D2UModule('60-3',
'D2U Guestbook - Gästebuch ohne Tabs',
11);
12);
return $modules;
}
}
3 changes: 1 addition & 2 deletions modules/60/1/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,10 @@ function d2u_guestbook_module_60_1_click_stars(wert) {

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

// action - showtext
Expand Down
3 changes: 1 addition & 2 deletions modules/60/3/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ function d2u_guestbook_module_60_3_click_stars(wert) {

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

// action - showtext
Expand Down
5 changes: 3 additions & 2 deletions pages/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@
<h2>Support</h2>
<p>Fehlermeldungen bitte im <a href="https://github.com/TobiasKrais/d2u_guestbook" target="_blank">GitHub Repository</a> melden.</p>
<h2>Changelog</h2>
<p>1.0.12-DEV:</p>
<p>1.0.12:</p>
<ul>
<li>...</li>
<li>Modul "60-1 D2U Guestbook - Gästebuch mit Bootstrap 4 Tabs": Fehler im Spamschutz und CSRF Schutz behoben.</li>
<li>Modul "60-3 D2U Guestbook - Gästebuch ohne Tabs": Fehler im Spamschutz und CSRF Schutz behoben.</li>
</ul>
<p>1.0.11:</p>
<ul>
Expand Down

0 comments on commit 8ff5928

Please sign in to comment.