forked from wallabag/wallabag
Compare commits
12 Commits
2.6.4
...
fix-bad-ur
| Author | SHA1 | Date | |
|---|---|---|---|
| 94303c92e6 | |||
| ec4d23b584 | |||
| c0414355aa | |||
| aaf4ab2d2a | |||
| 56983b01a8 | |||
| 6b7e9ec1df | |||
| f052f6f580 | |||
| 16a92c54a7 | |||
| 13b2752e8d | |||
| 634997c9b5 | |||
| ca608ece65 | |||
| 027042cc1a |
2
.github/workflows/assets.yml
vendored
2
.github/workflows/assets.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- 2.*
|
- "2.**"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
2
.github/workflows/coding-standards.yml
vendored
2
.github/workflows/coding-standards.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- 2.*
|
- "2.**"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
2
.github/workflows/continuous-integration.yml
vendored
2
.github/workflows/continuous-integration.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- 2.*
|
- "2.**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PGPASSWORD: wallabagrocks
|
PGPASSWORD: wallabagrocks
|
||||||
|
|||||||
2
.github/workflows/translations.yml
vendored
2
.github/workflows/translations.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- 2.*
|
- "2.**"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@ -1,5 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [2.6.5](https://github.com/wallabag/wallabag/tree/2.6.5)
|
||||||
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.4...2.6.5)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* "Fix checkboxes pointer-events disabled" by @Simounet https://github.com/wallabag/wallabag/pull/6874
|
||||||
|
* "Fix nav input styles" by @Simounet https://github.com/wallabag/wallabag/pull/6877
|
||||||
|
* "Change domain status filters html types" by @Simounet https://github.com/wallabag/wallabag/pull/6888
|
||||||
|
|
||||||
## [2.6.4](https://github.com/wallabag/wallabag/tree/2.6.4)
|
## [2.6.4](https://github.com/wallabag/wallabag/tree/2.6.4)
|
||||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.3...2.6.4)
|
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.3...2.6.4)
|
||||||
|
|
||||||
|
|||||||
@ -70,6 +70,7 @@ nav {
|
|||||||
|
|
||||||
.input-field input {
|
.input-field input {
|
||||||
display: block;
|
display: block;
|
||||||
|
font-size: 1.2rem;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
}
|
}
|
||||||
@ -79,6 +80,17 @@ nav {
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* materializecss override */
|
||||||
|
.input-field.input-field input {
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-field.input-field input:focus {
|
||||||
|
border-bottom: none;
|
||||||
|
box-shadow: initial;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-panel-top {
|
.nav-panel-top {
|
||||||
|
|||||||
@ -15,8 +15,11 @@ div.settings div.file-field {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* override materializecss pointer-event disabled on checkboxes */
|
||||||
|
[type="checkbox"]:not(:checked),
|
||||||
|
[type="checkbox"]:checked,
|
||||||
.input-field label {
|
.input-field label {
|
||||||
pointer-events: auto !important;
|
pointer-events: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-field label.active {
|
.input-field label.active {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
wallabag_core:
|
wallabag_core:
|
||||||
version: 2.6.4
|
version: 2.6.5
|
||||||
paypal_url: "https://liberapay.com/wallabag/donate"
|
paypal_url: "https://liberapay.com/wallabag/donate"
|
||||||
languages:
|
languages:
|
||||||
en: 'English'
|
en: 'English'
|
||||||
|
|||||||
@ -129,6 +129,7 @@
|
|||||||
"symfony/finder": "^4.4",
|
"symfony/finder": "^4.4",
|
||||||
"symfony/form": "^4.4",
|
"symfony/form": "^4.4",
|
||||||
"symfony/framework-bundle": "^4.4",
|
"symfony/framework-bundle": "^4.4",
|
||||||
|
"symfony/google-mailer": "^4.4",
|
||||||
"symfony/http-foundation": "^4.4",
|
"symfony/http-foundation": "^4.4",
|
||||||
"symfony/http-kernel": "^4.4",
|
"symfony/http-kernel": "^4.4",
|
||||||
"symfony/mailer": "^4.4",
|
"symfony/mailer": "^4.4",
|
||||||
@ -209,7 +210,11 @@
|
|||||||
"incenteev-parameters": {
|
"incenteev-parameters": {
|
||||||
"file": "app/config/parameters.yml"
|
"file": "app/config/parameters.yml"
|
||||||
},
|
},
|
||||||
"public-dir": "web"
|
"public-dir": "web",
|
||||||
|
"symfony": {
|
||||||
|
"allow-contrib": true,
|
||||||
|
"require": "4.4.*"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-install-cmd": [
|
"post-install-cmd": [
|
||||||
|
|||||||
509
composer.lock
generated
509
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -15,6 +15,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
|
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
|
||||||
@ -688,8 +689,15 @@ class EntryRestController extends WallabagRestController
|
|||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function postEntriesAction(Request $request, EntryRepository $entryRepository, ContentProxy $contentProxy, LoggerInterface $logger, TagsAssigner $tagsAssigner, EventDispatcherInterface $eventDispatcher)
|
public function postEntriesAction(
|
||||||
{
|
Request $request,
|
||||||
|
EntryRepository $entryRepository,
|
||||||
|
ContentProxy $contentProxy,
|
||||||
|
LoggerInterface $logger,
|
||||||
|
TagsAssigner $tagsAssigner,
|
||||||
|
EventDispatcherInterface $eventDispatcher,
|
||||||
|
ValidatorInterface $validator
|
||||||
|
) {
|
||||||
$this->validateAuthentication();
|
$this->validateAuthentication();
|
||||||
|
|
||||||
$url = $request->request->get('url');
|
$url = $request->request->get('url');
|
||||||
@ -760,6 +768,13 @@ class EntryRestController extends WallabagRestController
|
|||||||
$contentProxy->setDefaultEntryTitle($entry);
|
$contentProxy->setDefaultEntryTitle($entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$errors = $validator->validate($entry);
|
||||||
|
if (\count($errors) > 0) {
|
||||||
|
$errorsString = (string) $errors;
|
||||||
|
|
||||||
|
return $this->sendResponse($errorsString);
|
||||||
|
}
|
||||||
|
|
||||||
$this->entityManager->persist($entry);
|
$this->entityManager->persist($entry);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
|
|||||||
@ -197,6 +197,8 @@ class EntryController extends AbstractController
|
|||||||
// entry saved, dispatch event about it!
|
// entry saved, dispatch event about it!
|
||||||
$this->eventDispatcher->dispatch(new EntrySavedEvent($entry), EntrySavedEvent::NAME);
|
$this->eventDispatcher->dispatch(new EntrySavedEvent($entry), EntrySavedEvent::NAME);
|
||||||
|
|
||||||
|
return $this->redirect($this->generateUrl('homepage'));
|
||||||
|
} elseif ($form->isSubmitted() && !$form->isValid()) {
|
||||||
return $this->redirect($this->generateUrl('homepage'));
|
return $this->redirect($this->generateUrl('homepage'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,6 +78,9 @@ class Entry
|
|||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @Assert\NotBlank()
|
* @Assert\NotBlank()
|
||||||
|
* @Assert\Url(
|
||||||
|
* message = "The url '{{ value }}' is not a valid url",
|
||||||
|
* )
|
||||||
* @ORM\Column(name="url", type="text", nullable=true)
|
* @ORM\Column(name="url", type="text", nullable=true)
|
||||||
*
|
*
|
||||||
* @Groups({"entries_for_user", "export_all"})
|
* @Groups({"entries_for_user", "export_all"})
|
||||||
|
|||||||
@ -6,6 +6,7 @@ use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
|
|||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
|
||||||
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
|
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
||||||
@ -102,10 +103,13 @@ class EntryFilterType extends AbstractType
|
|||||||
return $filterQuery->createCondition($expression);
|
return $filterQuery->createCondition($expression);
|
||||||
},
|
},
|
||||||
'label' => 'entry.filters.domain_label',
|
'label' => 'entry.filters.domain_label',
|
||||||
|
'attr' => [
|
||||||
|
'autocapitalize' => 'off',
|
||||||
|
],
|
||||||
])
|
])
|
||||||
->add('httpStatus', TextFilterType::class, [
|
->add('httpStatus', NumberFilterType::class, [
|
||||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||||
$value = $values['value'];
|
$value = (int) $values['value'];
|
||||||
if (false === \array_key_exists($value, Response::$statusTexts)) {
|
if (false === \array_key_exists($value, Response::$statusTexts)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -117,6 +121,11 @@ class EntryFilterType extends AbstractType
|
|||||||
return $filterQuery->createCondition($expression, $parameters);
|
return $filterQuery->createCondition($expression, $parameters);
|
||||||
},
|
},
|
||||||
'label' => 'entry.filters.http_status_label',
|
'label' => 'entry.filters.http_status_label',
|
||||||
|
'html5' => true,
|
||||||
|
'attr' => [
|
||||||
|
'min' => 100,
|
||||||
|
'max' => 527,
|
||||||
|
],
|
||||||
])
|
])
|
||||||
->add('isArchived', CheckboxFilterType::class, [
|
->add('isArchived', CheckboxFilterType::class, [
|
||||||
'label' => 'entry.filters.archived_label',
|
'label' => 'entry.filters.archived_label',
|
||||||
|
|||||||
@ -509,6 +509,25 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
|||||||
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
|
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testBadFormatURL()
|
||||||
|
{
|
||||||
|
$this->client->request('POST', '/api/entries.json', [
|
||||||
|
'url' => 'wallabagIsAwesome',
|
||||||
|
'tags' => 'google',
|
||||||
|
'title' => 'New title for my article',
|
||||||
|
'content' => 'my content',
|
||||||
|
'language' => 'de',
|
||||||
|
'published_at' => '2016-09-08T11:55:58+0200',
|
||||||
|
'authors' => 'bob,helen',
|
||||||
|
'public' => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertSame(200, $this->client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||||
|
$this->assertStringContainsString('The url \'"wallabagIsAwesome"\' is not a valid url', $content);
|
||||||
|
}
|
||||||
|
|
||||||
public function testPostEntry()
|
public function testPostEntry()
|
||||||
{
|
{
|
||||||
$this->client->request('POST', '/api/entries.json', [
|
$this->client->request('POST', '/api/entries.json', [
|
||||||
|
|||||||
@ -20,6 +20,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||||||
public const AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE = 'https://www.lemonde.fr/judo/article/2017/11/11/judo-la-decima-de-teddy-riner_5213605_1556020.html';
|
public const AN_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE = 'https://www.lemonde.fr/judo/article/2017/11/11/judo-la-decima-de-teddy-riner_5213605_1556020.html';
|
||||||
public $downloadImagesEnabled = false;
|
public $downloadImagesEnabled = false;
|
||||||
public $url = 'https://www.lemonde.fr/pixels/article/2019/06/18/ce-qu-il-faut-savoir-sur-le-libra-la-cryptomonnaie-de-facebook_5477887_4408996.html';
|
public $url = 'https://www.lemonde.fr/pixels/article/2019/06/18/ce-qu-il-faut-savoir-sur-le-libra-la-cryptomonnaie-de-facebook_5477887_4408996.html';
|
||||||
|
public $wrongUrl = 'wallabagIsAwesome';
|
||||||
private $entryDataTestAttribute = '[data-test="entry"]';
|
private $entryDataTestAttribute = '[data-test="entry"]';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -137,9 +138,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||||||
|
|
||||||
$crawler = $client->submit($form);
|
$crawler = $client->submit($form);
|
||||||
|
|
||||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||||
$this->assertCount(1, $alert = $crawler->filter('form ul li')->extract(['_text']));
|
|
||||||
$this->assertSame('This value should not be blank.', $alert[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -423,6 +422,38 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||||||
$em->flush();
|
$em->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group NetworkCalls
|
||||||
|
*/
|
||||||
|
public function testBadFormatURL()
|
||||||
|
{
|
||||||
|
$this->logInAs('admin');
|
||||||
|
$client = $this->getTestClient();
|
||||||
|
|
||||||
|
$client->getContainer()->get(Config::class)->set('store_article_headers', 1);
|
||||||
|
|
||||||
|
$crawler = $client->request('GET', '/new');
|
||||||
|
|
||||||
|
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$form = $crawler->filter('form[name=entry]')->form();
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'entry[url]' => $this->wrongUrl,
|
||||||
|
];
|
||||||
|
|
||||||
|
$client->submit($form, $data);
|
||||||
|
|
||||||
|
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
|
$content = $client->getContainer()
|
||||||
|
->get(EntityManagerInterface::class)
|
||||||
|
->getRepository(Entry::class)
|
||||||
|
->findByUrlAndUserId($this->wrongUrl, $this->getLoggedInUserId());
|
||||||
|
|
||||||
|
$this->assertFalse($content);
|
||||||
|
}
|
||||||
|
|
||||||
public function testArchive()
|
public function testArchive()
|
||||||
{
|
{
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user