Skip to content

Commit

Permalink
Merge branch '3.2' into 'main'
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed May 30, 2024
2 parents 56b88da + 0b903fb commit 7c68fa6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions phpmyfaq/admin/category.main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/**
* List all categories in the admin section.
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/.
Expand Down
26 changes: 26 additions & 0 deletions phpmyfaq/sitemap.xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
use phpMyFAQ\Date;
use phpMyFAQ\Faq;
use phpMyFAQ\Filter;
use phpMyFAQ\Language;
use phpMyFAQ\Link;
use phpMyFAQ\Strings;
use phpMyFAQ\Translation;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

Expand Down Expand Up @@ -56,6 +58,30 @@
exit();
}

//
// Get language (default: english)
//
$Language = new Language($faqConfig);
$faqLangCode = $Language->setLanguage($faqConfig->get('main.languageDetection'), $faqConfig->get('main.language'));
$faqConfig->setLanguage($Language);

if (!Language::isASupportedLanguage($faqLangCode)) {
$faqLangCode = 'en';
}

//
// Set translation class
//
try {
Translation::create()
->setLanguagesDir(PMF_LANGUAGE_DIR)
->setDefaultLanguage('en')
->setCurrentLanguage($faqLangCode)
->setMultiByteLanguage();
} catch (Exception $e) {
echo '<strong>Error:</strong> ' . $e->getMessage();
}

/**
* @param string|null $lastModified
*/
Expand Down
6 changes: 1 addition & 5 deletions phpmyfaq/src/phpMyFAQ/Attachment/AttachmentAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
*/
abstract class AttachmentAbstract
{
/**
* Attachment id.
*
* @var int
*/
/** @var int Attachment id. */
protected int $id = 0;

/**
Expand Down

0 comments on commit 7c68fa6

Please sign in to comment.