Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update dependencies #86

Merged
merged 6 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: bw-captcha
type: typo3
docroot: public
php_version: "8.1"
php_version: "8.2"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
Expand Down
3 changes: 2 additions & 1 deletion Classes/Domain/Model/FormElements/CaptchaElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Blueways\BwCaptcha\Domain\Model\FormElements;

use Throwable;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
Expand All @@ -11,7 +12,7 @@
class CaptchaElement extends AbstractFormElement
{
/**
* @throws InvalidConfigurationTypeException
* @throws InvalidConfigurationTypeException&Throwable
*/
public function initializeFormElement(): void
{
Expand Down
13 changes: 4 additions & 9 deletions Classes/Middleware/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Throwable;
use TYPO3\CMS\Core\Crypto\PasswordHashing\InvalidPasswordHashException;
use TYPO3\CMS\Core\Routing\PageArguments;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
Expand All @@ -30,8 +31,8 @@ public function __construct(
}

/**
* @throws InvalidConfigurationTypeException
* @throws InvalidPasswordHashException
* @throws InvalidConfigurationTypeException&Throwable
* @throws InvalidPasswordHashException&Throwable
*/
public function process(
ServerRequestInterface $request,
Expand All @@ -44,13 +45,7 @@ public function process(
return $handler->handle($request);
}

$locale = $request->getAttribute('language')?->getLocale();
if ($locale instanceof \TYPO3\CMS\Core\Localization\Locale) {
$languageCode = $locale->getCountryCode() ?? '';
} else {
$languageCode = $request->getAttribute('language')?->getTwoLetterIsoCode() ?? '';
}

$languageCode = $request->getAttribute('language')?->getLocale()->getCountryCode() ?? '';
$body = $request->getParsedBody();

$ts = $this->configurationManager->getConfiguration(
Expand Down
3 changes: 2 additions & 1 deletion Classes/Middleware/Captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Throwable;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Routing\PageArguments;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
Expand All @@ -34,7 +35,7 @@ public function __construct(
}

/**
* @throws InvalidConfigurationTypeException
* @throws InvalidConfigurationTypeException&Throwable
*/
public function process(
ServerRequestInterface $request,
Expand Down
8 changes: 8 additions & 0 deletions Configuration/Icons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

return [
't3-form-captcha-element' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
'source' => 'EXT:bw_captcha/Resources/Public/Images/form-captcha-icon.svg',
],
];
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Captcha element with audio support for TYPO3 form components. The captcha generation does not rely on Google or third-party integrations.",
"require": {
"php": "^8.1",
"typo3/cms-core": "^11.0 || ^12.0 || ^13.0",
"typo3/cms-core": "^12.0 || ^13.0",
"ext-gd": "*"
},
"autoload": {
Expand All @@ -16,13 +16,13 @@
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"typo3/cms-base-distribution": "^12.0",
"typo3/cms-lowlevel": "^12.0",
"typo3/cms-base-distribution": "^12.4 || ^13.4",
"typo3/cms-lowlevel": "^12.4 || ^13.4",
"bk2k/bootstrap-package": "^15.0",
"friendsofphp/php-cs-fixer": "^3.12",
"saschaegerer/phpstan-typo3": "^1.9",
"helhum/typo3-console": "^8.0",
"derhansen/sf_event_mgt": "^7.6"
"helhum/typo3-console": "^7.0 || ^8.0",
"derhansen/sf_event_mgt": "^7.6 || ^8.0"
},
"extra": {
"typo3/cms": {
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'version' => '4.1.2',
'constraints' => [
'depends' => [
'typo3' => '11.0.0-13.99.99',
'typo3' => '12.0.0-13.99.99',
],
'conflicts' => [],
'suggests' => [],
Expand Down
15 changes: 0 additions & 15 deletions ext_icon.svg

This file was deleted.

16 changes: 6 additions & 10 deletions ext_localconf.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php

use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

defined('TYPO3') or die();

call_user_func(function () {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(trim('
call_user_func(static function () {
ExtensionManagementUtility::addTypoScriptSetup(trim('
module.tx_form {
settings {
yamlConfigurations {
Expand All @@ -13,15 +16,8 @@
}
'));

$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon(
't3-form-captcha-element',
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
['source' => 'EXT:bw_captcha/Resources/Public/Images/form-captcha-icon.svg']
);

$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'] ??= [];
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
ArrayUtility::mergeRecursiveWithOverrule(
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'],
['now']
);
Expand Down
Loading