mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-17 17:08:37 +00:00
Update bundle & stock file
- update stock file (AppKernel, app.php, etc ..) from SymfonyStandard edition) - update bundle to latest release - remove security on profiler
This commit is contained in:
parent
619cc45359
commit
5c895a7fd1
28 changed files with 208 additions and 203 deletions
|
@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
|||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||
use Wallabag\CoreBundle\Form\Type\ConfigType;
|
||||
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
|
||||
use Wallabag\CoreBundle\Form\Type\NewUserType;
|
||||
use Wallabag\CoreBundle\Form\Type\RssType;
|
||||
|
@ -31,7 +32,7 @@ class ConfigController extends Controller
|
|||
$user = $this->getUser();
|
||||
|
||||
// handle basic config detail (this form is defined as a service)
|
||||
$configForm = $this->createForm('config', $config, array('action' => $this->generateUrl('config')));
|
||||
$configForm = $this->createForm(ConfigType::class, $config, array('action' => $this->generateUrl('config')));
|
||||
$configForm->handleRequest($request);
|
||||
|
||||
if ($configForm->isValid()) {
|
||||
|
@ -51,7 +52,7 @@ class ConfigController extends Controller
|
|||
}
|
||||
|
||||
// handle changing password
|
||||
$pwdForm = $this->createForm(new ChangePasswordType(), null, array('action' => $this->generateUrl('config').'#set4'));
|
||||
$pwdForm = $this->createForm(ChangePasswordType::class, null, array('action' => $this->generateUrl('config').'#set4'));
|
||||
$pwdForm->handleRequest($request);
|
||||
|
||||
if ($pwdForm->isValid()) {
|
||||
|
@ -67,7 +68,7 @@ class ConfigController extends Controller
|
|||
}
|
||||
|
||||
// handle changing user information
|
||||
$userForm = $this->createForm(new UserInformationType(), $user, array(
|
||||
$userForm = $this->createForm(UserInformationType::class, $user, array(
|
||||
'validation_groups' => array('Profile'),
|
||||
'action' => $this->generateUrl('config').'#set3',
|
||||
));
|
||||
|
@ -85,7 +86,7 @@ class ConfigController extends Controller
|
|||
}
|
||||
|
||||
// handle rss information
|
||||
$rssForm = $this->createForm(new RssType(), $config, array('action' => $this->generateUrl('config').'#set2'));
|
||||
$rssForm = $this->createForm(RssType::class, $config, array('action' => $this->generateUrl('config').'#set2'));
|
||||
$rssForm->handleRequest($request);
|
||||
|
||||
if ($rssForm->isValid()) {
|
||||
|
@ -102,7 +103,7 @@ class ConfigController extends Controller
|
|||
|
||||
// handle tagging rule
|
||||
$taggingRule = new TaggingRule();
|
||||
$newTaggingRule = $this->createForm(new TaggingRuleType(), $taggingRule, array('action' => $this->generateUrl('config').'#set5'));
|
||||
$newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, array('action' => $this->generateUrl('config').'#set5'));
|
||||
$newTaggingRule->handleRequest($request);
|
||||
|
||||
if ($newTaggingRule->isValid()) {
|
||||
|
@ -122,7 +123,7 @@ class ConfigController extends Controller
|
|||
$newUser = $userManager->createUser();
|
||||
// enable created user by default
|
||||
$newUser->setEnabled(true);
|
||||
$newUserForm = $this->createForm(new NewUserType(), $newUser, array(
|
||||
$newUserForm = $this->createForm(NewUserType::class, $newUser, array(
|
||||
'validation_groups' => array('Profile'),
|
||||
'action' => $this->generateUrl('config').'#set5',
|
||||
));
|
||||
|
|
|
@ -43,7 +43,7 @@ class EntryController extends Controller
|
|||
{
|
||||
$entry = new Entry($this->getUser());
|
||||
|
||||
$form = $this->createForm(new NewEntryType(), $entry);
|
||||
$form = $this->createForm(NewEntryType::class, $entry);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
|
@ -117,7 +117,7 @@ class EntryController extends Controller
|
|||
{
|
||||
$this->checkUserAction($entry);
|
||||
|
||||
$form = $this->createForm(new EditEntryType(), $entry);
|
||||
$form = $this->createForm(EditEntryType::class, $entry);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
|
@ -234,7 +234,7 @@ class EntryController extends Controller
|
|||
throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
|
||||
}
|
||||
|
||||
$form = $this->get('form.factory')->create(new EntryFilterType($repository, $this->getUser()));
|
||||
$form = $this->createForm(new EntryFilterType($repository, $this->getUser()));
|
||||
|
||||
if ($request->query->has($form->getName())) {
|
||||
// manually bind values from the request
|
||||
|
|
|
@ -21,7 +21,7 @@ class TagController extends Controller
|
|||
public function addTagFormAction(Request $request, Entry $entry)
|
||||
{
|
||||
$tag = new Tag();
|
||||
$form = $this->createForm(new NewTagType(), $tag);
|
||||
$form = $this->createForm(NewTagType::class, $tag);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isValid()) {
|
||||
|
|
|
@ -4,6 +4,11 @@ namespace Wallabag\CoreBundle\Filter;
|
|||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
@ -29,8 +34,8 @@ class EntryFilterType extends AbstractType
|
|||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('readingTime', 'filter_number_range')
|
||||
->add('createdAt', 'filter_date_range', array(
|
||||
->add('readingTime', NumberRangeFilterType::class)
|
||||
->add('createdAt', DateRangeFilterType::class, array(
|
||||
'left_date_options' => array(
|
||||
'attr' => array(
|
||||
'placeholder' => 'dd/mm/yyyy',
|
||||
|
@ -47,7 +52,7 @@ class EntryFilterType extends AbstractType
|
|||
),
|
||||
)
|
||||
)
|
||||
->add('domainName', 'filter_text', array(
|
||||
->add('domainName', TextFilterType::class, array(
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
$value = $values['value'];
|
||||
if (strlen($value) <= 2 || empty($value)) {
|
||||
|
@ -58,9 +63,9 @@ class EntryFilterType extends AbstractType
|
|||
return $filterQuery->createCondition($expression);
|
||||
},
|
||||
))
|
||||
->add('isArchived', 'filter_checkbox')
|
||||
->add('isStarred', 'filter_checkbox')
|
||||
->add('previewPicture', 'filter_checkbox', array(
|
||||
->add('isArchived', CheckboxFilterType::class)
|
||||
->add('isStarred', CheckboxFilterType::class)
|
||||
->add('previewPicture', CheckboxFilterType::class, array(
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
if (false === $values['value']) {
|
||||
return;
|
||||
|
@ -71,8 +76,9 @@ class EntryFilterType extends AbstractType
|
|||
return $filterQuery->createCondition($expression);
|
||||
},
|
||||
))
|
||||
->add('language', 'filter_choice', array(
|
||||
'choices' => $this->repository->findDistinctLanguageByUser($this->user->getId()),
|
||||
->add('language', ChoiceFilterType::class, array(
|
||||
'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())),
|
||||
'choices_as_values' => true,
|
||||
))
|
||||
;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class ChangePasswordType extends AbstractType
|
|||
'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')),
|
||||
))
|
||||
->add('new_password', RepeatedType::class, array(
|
||||
'type' => 'password',
|
||||
'type' => PasswordType::class,
|
||||
'invalid_message' => 'The password fields must match.',
|
||||
'required' => true,
|
||||
'first_options' => array('label' => 'New password'),
|
||||
|
|
|
@ -36,7 +36,8 @@ class ConfigType extends AbstractType
|
|||
))
|
||||
->add('items_per_page')
|
||||
->add('language', ChoiceType::class, array(
|
||||
'choices' => $this->languages,
|
||||
'choices' => array_flip($this->languages),
|
||||
'choices_as_values' => true,
|
||||
))
|
||||
->add('save', SubmitType::class)
|
||||
;
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Form\Type;
|
|||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
|
@ -18,7 +19,7 @@ class NewUserType extends AbstractType
|
|||
$builder
|
||||
->add('username', TextType::class, array('required' => true))
|
||||
->add('plainPassword', RepeatedType::class, array(
|
||||
'type' => 'password',
|
||||
'type' => PasswordType::class,
|
||||
'constraints' => array(
|
||||
new Constraints\Length(array(
|
||||
'min' => 8,
|
||||
|
|
|
@ -19,7 +19,7 @@ class TaggingRuleType extends AbstractType
|
|||
;
|
||||
|
||||
$tagsField = $builder
|
||||
->create('tags', 'text')
|
||||
->create('tags', TextType::class)
|
||||
->addModelTransformer(new StringToListTransformer(','));
|
||||
|
||||
$builder->add($tagsField);
|
||||
|
|
|
@ -12,19 +12,7 @@ services:
|
|||
- %liip_theme.themes%
|
||||
- %wallabag_core.languages%
|
||||
tags:
|
||||
- { name: form.type, alias: config }
|
||||
|
||||
wallabag_core.form.registration:
|
||||
class: Wallabag\CoreBundle\Form\Type\RegistrationType
|
||||
tags:
|
||||
- { name: form.type, alias: wallabag_user_registration }
|
||||
|
||||
wallabag_core.form.type.forgot_password:
|
||||
class: Wallabag\CoreBundle\Form\Type\ForgotPasswordType
|
||||
arguments:
|
||||
- "@doctrine"
|
||||
tags:
|
||||
- { name: form.type, alias: forgot_password }
|
||||
- { name: form.type }
|
||||
|
||||
wallabag_core.param_converter.username_rsstoken_converter:
|
||||
class: Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter
|
||||
|
@ -66,13 +54,13 @@ services:
|
|||
# repository as a service
|
||||
wallabag_core.entry_repository:
|
||||
class: Wallabag\CoreBundle\Repository\EntryRepository
|
||||
factory: [ @doctrine.orm.default_entity_manager, getRepository ]
|
||||
factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
|
||||
arguments:
|
||||
- WallabagCoreBundle:Entry
|
||||
|
||||
wallabag_core.tag_repository:
|
||||
class: Wallabag\CoreBundle\Repository\TagRepository
|
||||
factory: [ @doctrine.orm.default_entity_manager, getRepository ]
|
||||
factory: [ "@doctrine.orm.default_entity_manager", getRepository ]
|
||||
arguments:
|
||||
- WallabagCoreBundle:Tag
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<form action="{{ path('config') }}" method="post" {{ form_enctype(form.new_tagging_rule) }}>
|
||||
{{ form_start(form.new_tagging_rule) }}
|
||||
{{ form_errors(form.new_tagging_rule) }}
|
||||
|
||||
<fieldset class="w500p inline">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{% block messages %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" class="fos_user_registration_register">
|
||||
{{ form_start(form) }}
|
||||
<fieldset class="w500p center">
|
||||
<h2 class="mbs txtcenter">{% trans %}create an account{% endtrans %}</h2>
|
||||
{% include "FOSUserBundle:Registration:register_content.html.twig" %}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% trans_default_domain 'FOSUserBundle' %}
|
||||
|
||||
<form action="{{ path('fos_user_change_password') }}" {{ form_enctype(form) }} method="POST" class="fos_user_change_password">
|
||||
{{ form_start(form, { 'action': path('fos_user_change_password'), 'attr': { 'class': 'fos_user_change_password' } }) }}
|
||||
<div class="card-content">
|
||||
<div class="row">
|
||||
{{ form_widget(form) }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% trans_default_domain 'FOSUserBundle' %}
|
||||
|
||||
<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }} method="POST" class="fos_user_registration_register">
|
||||
{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
|
||||
<div class="card-content">
|
||||
<div class="row">
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{% block fos_user_content %}
|
||||
<div class="card-content">
|
||||
<div class="row">
|
||||
{{ 'resetting.password_already_requested'|trans }}
|
||||
{{ 'resetting.password_already_requested'|trans }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock fos_user_content %}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% trans_default_domain 'FOSUserBundle' %}
|
||||
|
||||
<form action="{{ path('fos_user_resetting_reset', {'token': token}) }}" {{ form_enctype(form) }} method="POST" class="fos_user_resetting_reset">
|
||||
{{ form_start(form, { 'action': path('fos_user_resetting_reset', {'token': token}), 'attr': { 'class': 'fos_user_resetting_reset' } }) }}
|
||||
<div class="card-content">
|
||||
<div class="row">
|
||||
{{ form_widget(form) }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue