Skip to content

Commit ebff483

Browse files
committed
Merge branch 'composer-dependencies'
2 parents a539f7f + b183e32 commit ebff483

16 files changed

Lines changed: 811 additions & 713 deletions

.env.dirigent

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ MAILER_DSN=smtp://127.0.0.1:1025
4545
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
4646
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
4747
###< symfony/messenger ###
48+
49+
###> symfony/routing ###
50+
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
51+
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
52+
DEFAULT_URI=http://localhost
53+
###< symfony/routing ###

assets/controllers/csrf_protection_controller.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const nameCheck = /^[-_a-zA-Z0-9]{4,22}$/;
2-
const tokenCheck = /^[-_\/+a-zA-Z0-9]{24,}$/;
2+
const tokenCheck = /^[-_/+a-zA-Z0-9]{24,}$/;
33

44
// Generate and double-submit a CSRF token in a form field and a cookie, as defined by Symfony's SameOriginCsrfTokenManager
5+
// Use `form.requestSubmit()` to ensure that the submit event is triggered. Using `form.submit()` will not trigger the event
6+
// and thus this event-listener will not be executed.
57
document.addEventListener('submit', function (event) {
68
generateCsrfToken(event.target);
79
}, true);
@@ -33,8 +35,8 @@ export function generateCsrfToken (formElement) {
3335
if (!csrfCookie && nameCheck.test(csrfToken)) {
3436
csrfField.setAttribute('data-csrf-protection-cookie-value', csrfCookie = csrfToken);
3537
csrfField.defaultValue = csrfToken = btoa(String.fromCharCode.apply(null, (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(18))));
36-
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
3738
}
39+
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
3840

3941
if (csrfCookie && tokenCheck.test(csrfToken)) {
4042
const cookie = csrfCookie + '_' + csrfToken + '=' + csrfCookie + '; path=/; samesite=strict';

assets/stimulus_bootstrap.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// register any custom, 3rd party controllers here
2+
// app.register('some_controller_name', SomeImportedController);

bin/phpunit

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,4 @@
11
#!/usr/bin/env php
22
<?php
33

4-
if (!ini_get('date.timezone')) {
5-
ini_set('date.timezone', 'UTC');
6-
}
7-
8-
if (is_file(dirname(__DIR__) . '/vendor/phpunit/phpunit/phpunit')) {
9-
if (PHP_VERSION_ID >= 80000) {
10-
require dirname(__DIR__) . '/vendor/phpunit/phpunit/phpunit';
11-
} else {
12-
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__) . '/vendor/autoload.php');
13-
require PHPUNIT_COMPOSER_INSTALL;
14-
PHPUnit\TextUI\Command::main();
15-
}
16-
} else {
17-
if (!is_file(dirname(__DIR__) . '/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
18-
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
19-
exit(1);
20-
}
21-
22-
require dirname(__DIR__) . '/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
23-
}
4+
require dirname(__DIR__) . '/vendor/phpunit/phpunit/phpunit';

0 commit comments

Comments
 (0)