Browse Source

require allowed locales in routing requests

main
ghost 1 year ago
parent
commit
bc67ae2198
  1. 12
      src/Controller/ActivityController.php
  2. 28
      src/Controller/TorrentController.php
  3. 16
      src/Controller/UserController.php

12
src/Controller/ActivityController.php

@ -17,6 +17,9 @@ class ActivityController extends AbstractController @@ -17,6 +17,9 @@ class ActivityController extends AbstractController
#[Route(
'/{_locale}/activity',
name: 'activity_all',
requirements: [
'_locale' => '%app.locales%'
],
methods:
[
'GET'
@ -64,9 +67,6 @@ class ActivityController extends AbstractController @@ -64,9 +67,6 @@ class ActivityController extends AbstractController
#[Route(
'/{_locale}/rss/activity',
name: 'rss_activity',
defaults: [
'_locale' => '%app.locale%'
],
requirements: [
'_locale' => '%app.locales%'
],
@ -112,7 +112,6 @@ class ActivityController extends AbstractController @@ -112,7 +112,6 @@ class ActivityController extends AbstractController
'/{_locale}/rss/activity/user/{userId}',
name: 'rss_activity_user',
defaults: [
'_locale' => '%app.locale%',
'userId' => 0
],
requirements: [
@ -170,11 +169,8 @@ class ActivityController extends AbstractController @@ -170,11 +169,8 @@ class ActivityController extends AbstractController
#[Route(
'/{_locale}/rss/activity/torrent/{torrentId}',
name: 'rss_activity_torrent',
defaults: [
'_locale' => '%app.locale%',
],
requirements: [
'_locale' => '%app.locales%',
'_locale' => '%app.locales%',
'torrentId' => '\d+'
],
methods:

28
src/Controller/TorrentController.php

@ -21,6 +21,7 @@ class TorrentController extends AbstractController @@ -21,6 +21,7 @@ class TorrentController extends AbstractController
name: 'torrent_info',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
],
methods:
@ -201,6 +202,10 @@ class TorrentController extends AbstractController @@ -201,6 +202,10 @@ class TorrentController extends AbstractController
#[Route(
'/{_locale}/search',
name: 'torrent_search',
requirements:
[
'_locale' => '%app.locales%'
],
methods:
[
'GET'
@ -362,6 +367,10 @@ class TorrentController extends AbstractController @@ -362,6 +367,10 @@ class TorrentController extends AbstractController
#[Route(
'/{_locale}',
name: 'torrent_recent',
requirements:
[
'_locale' => '%app.locales%'
],
methods:
[
'GET'
@ -515,9 +524,6 @@ class TorrentController extends AbstractController @@ -515,9 +524,6 @@ class TorrentController extends AbstractController
#[Route(
'/{_locale}/rss/torrents',
name: 'rss_torrents_recent',
defaults: [
'_locale' => '%app.locale%'
],
requirements: [
'_locale' => '%app.locales%'
],
@ -596,6 +602,10 @@ class TorrentController extends AbstractController @@ -596,6 +602,10 @@ class TorrentController extends AbstractController
#[Route(
'/{_locale}/submit',
name: 'torrent_submit',
requirements:
[
'_locale' => '%app.locales%'
],
methods:
[
'GET',
@ -746,6 +756,7 @@ class TorrentController extends AbstractController @@ -746,6 +756,7 @@ class TorrentController extends AbstractController
name: 'torrent_approve_toggle',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
],
methods:
@ -822,6 +833,7 @@ class TorrentController extends AbstractController @@ -822,6 +833,7 @@ class TorrentController extends AbstractController
name: 'torrent_locales_edit',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
'torrentLocalesId' => '\d+',
],
@ -1021,6 +1033,7 @@ class TorrentController extends AbstractController @@ -1021,6 +1033,7 @@ class TorrentController extends AbstractController
name: 'torrent_locales_approve',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
'torrentLocalesId' => '\d+',
],
@ -1107,6 +1120,7 @@ class TorrentController extends AbstractController @@ -1107,6 +1120,7 @@ class TorrentController extends AbstractController
name: 'torrent_locales_delete',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
'torrentLocalesId' => '\d+',
],
@ -1181,7 +1195,8 @@ class TorrentController extends AbstractController @@ -1181,7 +1195,8 @@ class TorrentController extends AbstractController
name: 'torrent_sensitive_edit',
requirements:
[
'torrentId' => '\d+',
'_locale' => '%app.locales%',
'torrentId' => '\d+',
'torrentSensitiveId' => '\d+',
],
defaults:
@ -1350,6 +1365,7 @@ class TorrentController extends AbstractController @@ -1350,6 +1365,7 @@ class TorrentController extends AbstractController
name: 'torrent_sensitive_approve',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
'torrentSensitiveId' => '\d+',
],
@ -1436,6 +1452,7 @@ class TorrentController extends AbstractController @@ -1436,6 +1452,7 @@ class TorrentController extends AbstractController
name: 'torrent_sensitive_delete',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
'torrentSensitiveId' => '\d+',
],
@ -1510,6 +1527,7 @@ class TorrentController extends AbstractController @@ -1510,6 +1527,7 @@ class TorrentController extends AbstractController
name: 'torrent_star_toggle',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
],
methods:
@ -1588,6 +1606,7 @@ class TorrentController extends AbstractController @@ -1588,6 +1606,7 @@ class TorrentController extends AbstractController
name: 'torrent_download_file',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
],
methods:
@ -1708,6 +1727,7 @@ class TorrentController extends AbstractController @@ -1708,6 +1727,7 @@ class TorrentController extends AbstractController
name: 'torrent_download_magnet',
requirements:
[
'_locale' => '%app.locales%',
'torrentId' => '\d+',
],
methods:

16
src/Controller/UserController.php

@ -40,9 +40,6 @@ class UserController extends AbstractController @@ -40,9 +40,6 @@ class UserController extends AbstractController
#[Route(
'/{_locale}/settings',
name: 'user_settings',
defaults: [
'_locale' => '%app.locale%'
],
requirements: [
'_locale' => '%app.locales%',
],
@ -157,7 +154,6 @@ class UserController extends AbstractController @@ -157,7 +154,6 @@ class UserController extends AbstractController
'/{_locale}/profile/{userId}',
name: 'user_info',
defaults: [
'_locale' => '%app.locale%',
'userId' => 0,
],
requirements: [
@ -265,7 +261,8 @@ class UserController extends AbstractController @@ -265,7 +261,8 @@ class UserController extends AbstractController
name: 'user_star_toggle',
requirements:
[
'userId' => '\d+',
'_locale' => '%app.locales%',
'userId' => '\d+',
],
methods:
[
@ -341,7 +338,8 @@ class UserController extends AbstractController @@ -341,7 +338,8 @@ class UserController extends AbstractController
name: 'user_moderator_toggle',
requirements:
[
'userId' => '\d+',
'_locale' => '%app.locales%',
'userId' => '\d+',
],
methods:
[
@ -415,7 +413,8 @@ class UserController extends AbstractController @@ -415,7 +413,8 @@ class UserController extends AbstractController
name: 'user_status_toggle',
requirements:
[
'userId' => '\d+',
'_locale' => '%app.locales%',
'userId' => '\d+',
],
methods:
[
@ -489,7 +488,8 @@ class UserController extends AbstractController @@ -489,7 +488,8 @@ class UserController extends AbstractController
name: 'user_approved_toggle',
requirements:
[
'userId' => '\d+',
'_locale' => '%app.locales%',
'userId' => '\d+',
],
methods:
[

Loading…
Cancel
Save