Skip to content

Commit 5390e12

Browse files
committed
fix: corrected issues regarding the Symfony 7.4 update
1 parent d9fdb49 commit 5390e12

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

phpmyfaq/assets/templates/default/ucp.twig

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,14 @@
306306
<form action="{{ exportUserDataUrl }}" method="post">
307307
{{ csrfExportUserData | raw }}
308308
<input type="hidden" name="userid" value="{{ userid }}" />
309-
<button type="submit" class="btn btn-success">
310-
<i aria-hidden="true" class="bi bi-download"></i> {{ msgDownload }}
311-
</button>
309+
310+
<div class="row">
311+
<div class="col-12 text-end">
312+
<button type="submit" class="btn btn-primary">
313+
<i aria-hidden="true" class="bi bi-download"></i> {{ msgDownload }}
314+
</button>
315+
</div>
316+
</div>
312317
</form>
313318
</div>
314319
</div>

phpmyfaq/index.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,16 @@
138138
$error = null;
139139
$loginVisibility = 'hidden';
140140

141-
$faqusername = Filter::filterVar($request->attributes->get('faqusername'), FILTER_SANITIZE_SPECIAL_CHARS);
141+
$faqusername = Filter::filterVar($request->request->get('faqusername'), FILTER_SANITIZE_SPECIAL_CHARS);
142142
$faqpassword = Filter::filterVar(
143-
$request->attributes->get('faqpassword'),
143+
$request->request->get('faqpassword'),
144144
FILTER_SANITIZE_SPECIAL_CHARS,
145145
FILTER_FLAG_NO_ENCODE_QUOTES,
146146
);
147-
$faqaction = Filter::filterVar($request->attributes->get('faqloginaction'), FILTER_SANITIZE_SPECIAL_CHARS);
148-
$rememberMe = Filter::filterVar($request->attributes->get('faqrememberme'), FILTER_VALIDATE_BOOLEAN);
149-
$token = Filter::filterVar($request->attributes->get('token'), FILTER_SANITIZE_SPECIAL_CHARS);
150-
$userId = Filter::filterVar($request->attributes->get('userid'), FILTER_VALIDATE_INT);
147+
$faqaction = Filter::filterVar($request->request->get('faqloginaction'), FILTER_SANITIZE_SPECIAL_CHARS);
148+
$rememberMe = Filter::filterVar($request->request->get('faqrememberme'), FILTER_VALIDATE_BOOLEAN);
149+
$token = Filter::filterVar($request->request->get('token'), FILTER_SANITIZE_SPECIAL_CHARS);
150+
$userId = (int) Filter::filterVar($request->request->get('userid'), FILTER_VALIDATE_INT);
151151

152152
//
153153
// Set username via SSO

phpmyfaq/src/phpMyFAQ/Controller/Frontend/UserController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function updateData(Request $request): JsonResponse
6060
$password = trim((string) Filter::filterVar($data->faqpassword, FILTER_SANITIZE_SPECIAL_CHARS));
6161
$confirm = trim((string) Filter::filterVar($data->faqpassword_confirm, FILTER_SANITIZE_SPECIAL_CHARS));
6262
$twoFactorEnabled = Filter::filterVar($data->twofactor_enabled ?? 'off', FILTER_SANITIZE_SPECIAL_CHARS);
63-
$secret = Filter::filterVar($data->secret, FILTER_SANITIZE_SPECIAL_CHARS);
63+
$secret = Filter::filterVar($data->secret ?? '', FILTER_SANITIZE_SPECIAL_CHARS);
6464

6565
$isAzureAdUser = $this->currentUser->getUserAuthSource() === 'azure';
6666
$isWebAuthnUser = $this->currentUser->getUserAuthSource() === 'webauthn';

phpmyfaq/src/phpMyFAQ/Helper/SearchHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* Helper class for phpMyFAQ search.
75
*
@@ -17,6 +15,8 @@
1715
* @since 2009-09-07
1816
*/
1917

18+
declare(strict_types=1);
19+
2020
namespace phpMyFAQ\Helper;
2121

2222
use Exception;
@@ -92,7 +92,7 @@ public function createAutoCompleteResult(SearchResultSet $searchResultSet): arra
9292
$link = new Link($currentUrl, $this->configuration);
9393
$link->setTitle($result->question);
9494
$faq = new stdClass();
95-
$faq->category = $this->Category->getPath($result->category_id ?? 0);
95+
$faq->category = $this->Category->getPath((int) $result->category_id ?? 0);
9696
$faq->question = Utils::chopString($question, 15);
9797
$faq->url = $link->toString();
9898

0 commit comments

Comments
 (0)