Compare commits

..

1 Commits
2.3.7 ... 2.3.6

Author SHA1 Message Date
3f7a28de84 Release wallabag 2.3.6 2019-01-11 17:16:00 +01:00
28 changed files with 155 additions and 289 deletions

View File

@ -1,23 +1,5 @@
# Changelog
## [2.3.7](https://github.com/wallabag/wallabag/tree/2.3.7)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.6...2.3.7)
### Fixes
- Jump to 2.3.7-dev [#3837](https://github.com/wallabag/wallabag/pull/3837)
- Fix bad order parameter in the API [#3841](https://github.com/wallabag/wallabag/pull/3841)
- Update composer.json to add php-tidy (ext-tidy) [#3853](https://github.com/wallabag/wallabag/pull/3853)
- Add dedicated email for site config issue [#3861](https://github.com/wallabag/wallabag/pull/3861)
- Fix read & starred status in Pocket import [#3819](https://github.com/wallabag/wallabag/pull/3819)
- Fix broken 2 factor auth logo image [#3869](https://github.com/wallabag/wallabag/pull/3869)
- Fix CORS for API [#3882](https://github.com/wallabag/wallabag/pull/3882)
- Add support of expect parameter to change return object when deleting entry [#3887](https://github.com/wallabag/wallabag/pull/3887)
- epub export: fix missing cover image, only for exports of one article [#3886](https://github.com/wallabag/wallabag/pull/3886)
- Allow optional --ignore-root-warning [#3885](https://github.com/wallabag/wallabag/pull/3885)
- material: fix left padding of content on medium screens [#3893](https://github.com/wallabag/wallabag/pull/3893)
- material: hide creation date from card actions on specific sizes [#3894](https://github.com/wallabag/wallabag/pull/3894)
## [2.3.6](https://github.com/wallabag/wallabag/tree/2.3.6)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.5...2.3.6)

View File

@ -102,11 +102,6 @@ main {
display: inline-flex;
vertical-align: middle;
.card-reading-time,
.card-created-at {
display: inline-flex;
}
span {
margin-right: 5px;
}
@ -277,3 +272,9 @@ a.original:not(.waves-effect) {
.settings .div_tabs {
padding-bottom: 15px;
}
@media only screen and (min-width: 992px) {
.card-tag-labels li {
max-width: 50%;
}
}

View File

@ -12,16 +12,6 @@
.pagination {
margin-left: auto;
}
.card-tag-labels li {
max-width: 50%;
}
}
@media screen and (min-width: 993px) {
main #content {
padding-left: 70px;
}
}
@media only screen and (max-width: 992px) {
@ -174,12 +164,3 @@
padding: 0;
}
}
@media screen and (max-width: 310px),
screen and (min-width: 601px) and (max-width: 660px),
screen and (min-width: 993px) and (max-width: 1050px),
screen and (min-width: 1201px) and (max-width: 1250px) {
.card .card-action .reading-time .card-created-at {
display: none;
}
}

View File

@ -147,18 +147,18 @@ nelmio_cors:
paths:
'^/api/':
allow_origin: ['*']
allow_headers: ['Authorization','content-type']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'PATCH','GET', 'DELETE']
max_age: 3600
'^/oauth/':
allow_origin: ['*']
allow_headers: ['Authorization','content-type']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
'^/':
#origin_regex: true
allow_origin: ['*']
allow_headers: ['Authorization','content-type']
allow_origin: ['^http://localhost:[0-9]+']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
hosts: ['^api\.']

View File

@ -1,5 +1,5 @@
wallabag_core:
version: 2.3.7
version: 2.3.6
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
languages:
en: 'English'

View File

@ -43,7 +43,6 @@
"ext-iconv": "*",
"ext-tokenizer": "*",
"ext-pdo": "*",
"ext-tidy": "*",
"symfony/symfony": "~3.3.13",
"doctrine/orm": "^2.5.12",
"doctrine/doctrine-bundle": "^1.8.0",
@ -92,7 +91,7 @@
"doctrine/doctrine-fixtures-bundle": "~2.2",
"doctrine/data-fixtures": "~1.1",
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^4.2",
"symfony/phpunit-bridge": "3.4.x-dev",
"friendsofphp/php-cs-fixer": "~2.0",
"m6web/redis-mock": "^2.0",
"dama/doctrine-test-bundle": "^4.0"

144
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9cd56d6ca82444bb7d172424c0ffb378",
"content-hash": "d2a0bd8408dccdeb7a7455996519829b",
"packages": [
{
"name": "bdunogier/guzzle-site-authenticator",
@ -102,16 +102,16 @@
},
{
"name": "composer/ca-bundle",
"version": "1.1.4",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
"reference": "558f321c52faeb4828c03e7dc0cfe39a09e09a2d"
"reference": "8afa52cd417f4ec417b4bfe86b68106538a87660"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/558f321c52faeb4828c03e7dc0cfe39a09e09a2d",
"reference": "558f321c52faeb4828c03e7dc0cfe39a09e09a2d",
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/8afa52cd417f4ec417b4bfe86b68106538a87660",
"reference": "8afa52cd417f4ec417b4bfe86b68106538a87660",
"shasum": ""
},
"require": {
@ -154,7 +154,7 @@
"ssl",
"tls"
],
"time": "2019-01-28T09:30:10+00:00"
"time": "2018-10-18T06:09:13+00:00"
},
{
"name": "craue/config-bundle",
@ -631,16 +631,16 @@
},
{
"name": "doctrine/doctrine-bundle",
"version": "1.10.2",
"version": "1.10.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/DoctrineBundle.git",
"reference": "1f99e6645030542079c57d4680601a4a8778a1bd"
"reference": "98551d71f515692c2278073e0d483763ac70b341"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/1f99e6645030542079c57d4680601a4a8778a1bd",
"reference": "1f99e6645030542079c57d4680601a4a8778a1bd",
"url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/98551d71f515692c2278073e0d483763ac70b341",
"reference": "98551d71f515692c2278073e0d483763ac70b341",
"shasum": ""
},
"require": {
@ -712,7 +712,7 @@
"orm",
"persistence"
],
"time": "2019-02-06T13:18:04+00:00"
"time": "2019-01-07T15:31:08+00:00"
},
{
"name": "doctrine/doctrine-cache-bundle",
@ -1407,16 +1407,16 @@
},
{
"name": "friendsofsymfony/oauth-server-bundle",
"version": "1.6.2",
"version": "1.6.1",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfSymfony/FOSOAuthServerBundle.git",
"reference": "fcaa25cc49474bdb0db7894f880976fe76ffed23"
"reference": "5cc4c8555dedb5c7e737a35789bd429ccd9ad254"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FriendsOfSymfony/FOSOAuthServerBundle/zipball/fcaa25cc49474bdb0db7894f880976fe76ffed23",
"reference": "fcaa25cc49474bdb0db7894f880976fe76ffed23",
"url": "https://api.github.com/repos/FriendsOfSymfony/FOSOAuthServerBundle/zipball/5cc4c8555dedb5c7e737a35789bd429ccd9ad254",
"reference": "5cc4c8555dedb5c7e737a35789bd429ccd9ad254",
"shasum": ""
},
"require": {
@ -1440,7 +1440,6 @@
"symfony/form": "~2.8|~3.0|^4.0",
"symfony/phpunit-bridge": "~2.8|~3.0|^4.0",
"symfony/templating": "~2.8|~3.0|^4.0",
"symfony/twig-bundle": "~2.8|~3.0|^4.0",
"symfony/yaml": "~2.8|~3.0|^4.0",
"willdurand/propel-typehintable-behavior": "^1.0.4"
},
@ -1487,7 +1486,7 @@
"oauth2",
"server"
],
"time": "2019-01-23T15:23:04+00:00"
"time": "2018-04-18T13:46:16+00:00"
},
{
"name": "friendsofsymfony/oauth2-php",
@ -3126,16 +3125,16 @@
},
{
"name": "j0k3r/graby",
"version": "1.19.1",
"version": "1.18.0",
"source": {
"type": "git",
"url": "https://github.com/j0k3r/graby.git",
"reference": "6c1506f19d1bb876fb26bfc11e3e11a993eb7fe8"
"reference": "7ac1e2d696744c1f7c9c76658677efda33df020a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/j0k3r/graby/zipball/6c1506f19d1bb876fb26bfc11e3e11a993eb7fe8",
"reference": "6c1506f19d1bb876fb26bfc11e3e11a993eb7fe8",
"url": "https://api.github.com/repos/j0k3r/graby/zipball/7ac1e2d696744c1f7c9c76658677efda33df020a",
"reference": "7ac1e2d696744c1f7c9c76658677efda33df020a",
"shasum": ""
},
"require": {
@ -3181,20 +3180,20 @@
}
],
"description": "Graby helps you extract article content from web pages",
"time": "2019-02-13T10:04:47+00:00"
"time": "2019-01-08T09:12:43+00:00"
},
{
"name": "j0k3r/graby-site-config",
"version": "1.0.76",
"version": "1.0.72",
"source": {
"type": "git",
"url": "https://github.com/j0k3r/graby-site-config.git",
"reference": "efc1be6a13c27414c2b7ad44568949b1045c6dc8"
"reference": "b76b230cf044e134574de7cd7af09d6b01ab0f15"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/efc1be6a13c27414c2b7ad44568949b1045c6dc8",
"reference": "efc1be6a13c27414c2b7ad44568949b1045c6dc8",
"url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/b76b230cf044e134574de7cd7af09d6b01ab0f15",
"reference": "b76b230cf044e134574de7cd7af09d6b01ab0f15",
"shasum": ""
},
"require": {
@ -3221,33 +3220,33 @@
}
],
"description": "Graby site config files",
"time": "2019-03-04T09:22:34+00:00"
"time": "2019-01-11T12:55:48+00:00"
},
{
"name": "j0k3r/php-readability",
"version": "1.2.1",
"version": "1.1.11",
"source": {
"type": "git",
"url": "https://github.com/j0k3r/php-readability.git",
"reference": "3c0289bf8943cbef6a2cc89b645c33617fd38066"
"reference": "eef6d6d456d941939fa714ca3725bf7e3cd04d1e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/j0k3r/php-readability/zipball/3c0289bf8943cbef6a2cc89b645c33617fd38066",
"reference": "3c0289bf8943cbef6a2cc89b645c33617fd38066",
"url": "https://api.github.com/repos/j0k3r/php-readability/zipball/eef6d6d456d941939fa714ca3725bf7e3cd04d1e",
"reference": "eef6d6d456d941939fa714ca3725bf7e3cd04d1e",
"shasum": ""
},
"require": {
"electrolinux/php-html5lib": "^0.1.0",
"ext-mbstring": "*",
"php": ">=5.6.0",
"php": ">=5.3.3",
"psr/log": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.14",
"monolog/monolog": "^1.24",
"php-coveralls/php-coveralls": "^2.1",
"symfony/phpunit-bridge": "^4.2.3"
"friendsofphp/php-cs-fixer": "<2",
"monolog/monolog": "^1.13",
"satooshi/php-coveralls": "~0.6",
"symfony/phpunit-bridge": "^3.2"
},
"suggest": {
"ext-tidy": "Used to clean up given HTML and to avoid problems with bad HTML structure."
@ -3295,7 +3294,7 @@
"extraction",
"html"
],
"time": "2019-02-07T15:08:33+00:00"
"time": "2018-11-26T15:54:20+00:00"
},
{
"name": "j0k3r/safecurl",
@ -4295,16 +4294,16 @@
},
{
"name": "nelmio/cors-bundle",
"version": "1.5.5",
"version": "1.5.4",
"source": {
"type": "git",
"url": "https://github.com/nelmio/NelmioCorsBundle.git",
"reference": "adabee944e6fe52ee566caf1770a29355b1e8d83"
"reference": "548dc8ebd3984acd2f6d8787ab1dac2e9aa14254"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/adabee944e6fe52ee566caf1770a29355b1e8d83",
"reference": "adabee944e6fe52ee566caf1770a29355b1e8d83",
"url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/548dc8ebd3984acd2f6d8787ab1dac2e9aa14254",
"reference": "548dc8ebd3984acd2f6d8787ab1dac2e9aa14254",
"shasum": ""
},
"require": {
@ -4349,7 +4348,7 @@
"cors",
"crossdomain"
],
"time": "2019-02-27T13:13:15+00:00"
"time": "2017-12-11T18:41:54+00:00"
},
{
"name": "ocramius/proxy-manager",
@ -5473,21 +5472,20 @@
},
{
"name": "smalot/pdfparser",
"version": "v0.14.0",
"version": "v0.13.2",
"source": {
"type": "git",
"url": "https://github.com/smalot/pdfparser.git",
"reference": "ec72a99028ba5e21a0acad92047b85e128cbf81f"
"reference": "f5e85c023491aecc88e8f6227536d60e1bb4a241"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/smalot/pdfparser/zipball/ec72a99028ba5e21a0acad92047b85e128cbf81f",
"reference": "ec72a99028ba5e21a0acad92047b85e128cbf81f",
"url": "https://api.github.com/repos/smalot/pdfparser/zipball/f5e85c023491aecc88e8f6227536d60e1bb4a241",
"reference": "f5e85c023491aecc88e8f6227536d60e1bb4a241",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
"ext-iconv": "*",
"php": ">=5.3.0",
"tecnickcom/tcpdf": "~6.0"
},
@ -5519,7 +5517,7 @@
"pdf",
"text"
],
"time": "2019-01-23T09:14:37+00:00"
"time": "2018-06-23T08:43:13+00:00"
},
{
"name": "sonata-project/google-authenticator",
@ -6474,20 +6472,20 @@
},
{
"name": "twig/twig",
"version": "v1.37.1",
"version": "v1.36.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62"
"reference": "730c9c4471b5152d23061feb02b03382264c8a15"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/66be9366c76cbf23e82e7171d47cbfa54a057a62",
"reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/730c9c4471b5152d23061feb02b03382264c8a15",
"reference": "730c9c4471b5152d23061feb02b03382264c8a15",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"php": ">=5.3.3",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
@ -6498,7 +6496,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.37-dev"
"dev-master": "1.36-dev"
}
},
"autoload": {
@ -6536,7 +6534,7 @@
"keywords": [
"templating"
],
"time": "2019-01-14T14:59:29+00:00"
"time": "2018-12-16T10:34:11+00:00"
},
{
"name": "wallabag/php-mobi",
@ -6771,7 +6769,7 @@
"email": "adrien.brault@gmail.com"
},
{
"name": "William Durand",
"name": "William DURAND",
"email": "william.durand1@gmail.com"
}
],
@ -6821,7 +6819,7 @@
],
"authors": [
{
"name": "William Durand",
"name": "William DURAND",
"email": "william.durand1@gmail.com"
}
],
@ -7096,16 +7094,16 @@
},
{
"name": "composer/xdebug-handler",
"version": "1.3.2",
"version": "1.3.1",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
"reference": "d17708133b6c276d6e42ef887a877866b909d892"
"reference": "dc523135366eb68f22268d069ea7749486458562"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892",
"reference": "d17708133b6c276d6e42ef887a877866b909d892",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/dc523135366eb68f22268d069ea7749486458562",
"reference": "dc523135366eb68f22268d069ea7749486458562",
"shasum": ""
},
"require": {
@ -7136,7 +7134,7 @@
"Xdebug",
"performance"
],
"time": "2019-01-28T20:25:53+00:00"
"time": "2018-11-29T10:59:02+00:00"
},
{
"name": "dama/doctrine-test-bundle",
@ -7559,16 +7557,16 @@
},
{
"name": "symfony/phpunit-bridge",
"version": "v4.2.4",
"version": "3.4.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/phpunit-bridge.git",
"reference": "2cc651a38fcb831a405c14fcb76fcb00320e7ee8"
"reference": "5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/2cc651a38fcb831a405c14fcb76fcb00320e7ee8",
"reference": "2cc651a38fcb831a405c14fcb76fcb00320e7ee8",
"url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5",
"reference": "5dab0d4b2ac99ab22b447b615fdfdc10ec4af3d5",
"shasum": ""
},
"require": {
@ -7578,6 +7576,7 @@
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
},
"suggest": {
"ext-zip": "Zip support is required when using bin/simple-phpunit",
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
},
"bin": [
@ -7586,7 +7585,7 @@
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-master": "4.2-dev"
"dev-master": "3.4-dev"
},
"thanks": {
"name": "phpunit/phpunit",
@ -7620,7 +7619,7 @@
],
"description": "Symfony PHPUnit Bridge",
"homepage": "https://symfony.com",
"time": "2019-02-18T06:49:49+00:00"
"time": "2019-01-01T13:45:19+00:00"
},
{
"name": "symfony/polyfill-php72",
@ -7680,7 +7679,9 @@
],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": [],
"stability-flags": {
"symfony/phpunit-bridge": 20
},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
@ -7698,8 +7699,7 @@
"ext-xml": "*",
"ext-iconv": "*",
"ext-tokenizer": "*",
"ext-pdo": "*",
"ext-tidy": "*"
"ext-pdo": "*"
},
"platform-dev": [],
"platform-overrides": {

View File

@ -5,17 +5,9 @@
IGNORE_ROOT_ARG="--ignore-root-warning"
IGNORE_ROOT=0
while :; do
case $1 in
$IGNORE_ROOT_ARG) IGNORE_ROOT=1
;;
*[a-zA-Z]) ENV=$1
;;
*) break
;;
esac
shift
done
if [ "$1" == "$IGNORE_ROOT_ARG" ]; then
IGNORE_ROOT=1
fi
# Abort running this script if root
if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
@ -30,6 +22,7 @@ DIR="${BASH_SOURCE}"
if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
. "$DIR/require.sh"
ENV=$1
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
git checkout $TAG

View File

@ -5,17 +5,9 @@
IGNORE_ROOT_ARG="--ignore-root-warning"
IGNORE_ROOT=0
while :; do
case $1 in
$IGNORE_ROOT_ARG) IGNORE_ROOT=1
;;
*[a-zA-Z]) ENV=$1
;;
*) break
;;
esac
shift
done
if [ "$1" == "$IGNORE_ROOT_ARG" ]; then
IGNORE_ROOT=1
fi
# Abort running this script if root
if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
@ -33,6 +25,8 @@ DIR="${BASH_SOURCE}"
if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
. "$DIR/require.sh"
ENV=$1
rm -rf var/cache/*
git fetch origin
git fetch --tags

View File

@ -9,7 +9,6 @@ use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Wallabag\CoreBundle\Entity\Entry;
@ -99,28 +98,24 @@ class EntryRestController extends WallabagRestController
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
$isPublic = (null === $request->query->get('public')) ? null : (bool) $request->query->get('public');
$sort = strtolower($request->query->get('sort', 'created'));
$order = strtolower($request->query->get('order', 'desc'));
$sort = $request->query->get('sort', 'created');
$order = $request->query->get('order', 'desc');
$page = (int) $request->query->get('page', 1);
$perPage = (int) $request->query->get('perPage', 30);
$tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', '');
$since = $request->query->get('since', 0);
try {
/** @var \Pagerfanta\Pagerfanta $pager */
$pager = $this->get('wallabag_core.entry_repository')->findEntries(
$this->getUser()->getId(),
$isArchived,
$isStarred,
$isPublic,
$sort,
$order,
$since,
$tags
);
} catch (\Exception $e) {
throw new BadRequestHttpException($e->getMessage());
}
/** @var \Pagerfanta\Pagerfanta $pager */
$pager = $this->get('wallabag_core.entry_repository')->findEntries(
$this->getUser()->getId(),
$isArchived,
$isStarred,
$isPublic,
$sort,
$order,
$since,
$tags
);
$pager->setMaxPerPage($perPage);
$pager->setCurrentPage($page);
@ -570,31 +565,18 @@ class EntryRestController extends WallabagRestController
* @ApiDoc(
* requirements={
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* },
* parameters={
* {"name"="expect", "dataType"="string", "required"=false, "format"="id or entry", "description"="Only returns the id instead of the deleted entry's full entity if 'id' is specified. Default to entry"},
* }
* )
*
* @return JsonResponse
*/
public function deleteEntriesAction(Entry $entry, Request $request)
public function deleteEntriesAction(Entry $entry)
{
$expect = $request->query->get('expect', 'entry');
if (!\in_array($expect, ['id', 'entry'], true)) {
throw new BadRequestHttpException(sprintf("expect: 'id' or 'entry' expected, %s given", $expect));
}
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
$response = $this->sendResponse([
'id' => $entry->getId(),
]);
// We clone $entry to keep id in returned object
if ('entry' === $expect) {
$e = clone $entry;
$response = $this->sendResponse($e);
}
// We copy $entry to keep id in returned object
$e = $entry;
$em = $this->getDoctrine()->getManager();
$em->remove($entry);
@ -603,7 +585,7 @@ class EntryRestController extends WallabagRestController
// entry deleted, dispatch event about it!
$this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
return $response;
return $this->sendResponse($e);
}
/**

View File

@ -108,7 +108,7 @@ class EntryFilterType extends AbstractType
->add('httpStatus', TextFilterType::class, [
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
$value = $values['value'];
if (false === \array_key_exists($value, Response::$statusTexts)) {
if (false === array_key_exists($value, Response::$statusTexts)) {
return;
}

View File

@ -165,6 +165,13 @@ class EntriesExport
$book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'PHP');
$book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'wallabag');
/*
* Front page
*/
if (file_exists($this->logoPath)) {
$book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png');
}
$entryIds = [];
$entryCount = \count($this->entries);
$i = 0;
@ -176,15 +183,6 @@ class EntriesExport
// set tags as subjects
foreach ($this->entries as $entry) {
++$i;
/*
* Front page
* Set if there's only one entry in the given set
*/
if (1 === $entryCount && null !== $entry->getPreviewPicture()) {
$book->setCoverImage($entry->getPreviewPicture());
}
foreach ($entry->getTags() as $tag) {
$book->setSubject($tag->getLabel());
}

View File

@ -23,7 +23,7 @@ class PreparePagerForEntries
* @param AdapterInterface $adapter
* @param User $user If user isn't logged in, we can force it (like for rss)
*
* @return Pagerfanta|null
* @return null|Pagerfanta
*/
public function prepare(AdapterInterface $adapter, User $user = null)
{

View File

@ -142,7 +142,7 @@ class EntryRepository extends EntityRepository
*
* @return Pagerfanta
*/
public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'asc', $since = 0, $tags = '')
public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'ASC', $since = 0, $tags = '')
{
$qb = $this->createQueryBuilder('e')
->leftJoin('e.tags', 't')
@ -185,10 +185,6 @@ class EntryRepository extends EntityRepository
}
}
if (!\in_array(strtolower($order), ['asc', 'desc'], true)) {
throw new \Exception('Order "' . $order . '" parameter is wrong, allowed: asc or desc');
}
if ('created' === $sort) {
$qb->orderBy('e.id', $order);
} elseif ('updated' === $sort) {

View File

@ -22,7 +22,7 @@ class SiteCredentialRepository extends \Doctrine\ORM\EntityRepository
* @param string $host
* @param int $userId
*
* @return array|null
* @return null|array
*/
public function findOneByHostAndUser($host, $userId)
{

View File

@ -38,7 +38,7 @@
{% if craue_setting('export_epub') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'epub' }) }}" title="Generate ePub file">EPUB</a></li>{% endif %}
{% if craue_setting('export_mobi') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'mobi' }) }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
{% if craue_setting('export_pdf') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'pdf' }) }}" title="Generate PDF file">PDF</a></li>{% endif %}
<li><a href="mailto:siteconfig@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.label'|trans }}" class="tool bad-display icon icon-delete"><span>{{ 'entry.view.left_menu.problem.label'|trans }}</span></a></li>
<li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.label'|trans }}" class="tool bad-display icon icon-delete"><span>{{ 'entry.view.left_menu.problem.label'|trans }}</span></a></li>
</ul>
</div>

View File

@ -1,11 +1,9 @@
<div class="card-action">
<div class="reading-time grey-text">
<div class="card-reading-time">{% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}</div>
<div class="card-created-at">
<i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i>
<span>&nbsp;{{ entry.createdAt|date('Y-m-d') }}</span>
</div>
</div>
<span class="reading-time grey-text">
{% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
<i class="material-icons hide-on-med-and-down" title="{{ 'entry.view.created_at'|trans }}">today</i>
<span class="hide-on-med-and-down">&nbsp;{{ entry.createdAt|date('Y-m-d') }}</span>
</span>
<ul class="tools right">
<li>

View File

@ -209,7 +209,7 @@
</li>
<li class="bold">
<a class="waves-effect collapsible-header" href="mailto:siteconfig@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.description'|trans }}">
<a class="waves-effect collapsible-header" href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.description'|trans }}">
<i class="material-icons small">error</i>
<span>{{ 'entry.view.left_menu.problem.label'|trans }}</span>
</a>

View File

@ -77,7 +77,7 @@ abstract class BrowserImport extends AbstractImport
*/
public function parseEntry(array $importedEntry)
{
if ((!\array_key_exists('guid', $importedEntry) || (!\array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) {
if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) {
if ($this->producer) {
$this->parseEntriesForProducer($importedEntry);
@ -89,7 +89,7 @@ abstract class BrowserImport extends AbstractImport
return;
}
if (\array_key_exists('children', $importedEntry)) {
if (array_key_exists('children', $importedEntry)) {
if ($this->producer) {
$this->parseEntriesForProducer($importedEntry['children']);
@ -101,11 +101,11 @@ abstract class BrowserImport extends AbstractImport
return;
}
if (!\array_key_exists('uri', $importedEntry) && !\array_key_exists('url', $importedEntry)) {
if (!array_key_exists('uri', $importedEntry) && !array_key_exists('url', $importedEntry)) {
return;
}
$url = \array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url'];
$url = array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url'];
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
@ -126,7 +126,7 @@ abstract class BrowserImport extends AbstractImport
// update entry with content (in case fetching failed, the given entry will be return)
$this->fetchContent($entry, $data['url'], $data);
if (\array_key_exists('tags', $data)) {
if (array_key_exists('tags', $data)) {
$this->tagsAssigner->assignTagsToEntry(
$entry,
$data['tags']

View File

@ -57,7 +57,7 @@ class ChromeImport extends BrowserImport
'created_at' => substr($entry['date_added'], 0, 10),
];
if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) {
if (array_key_exists('tags', $entry) && '' !== $entry['tags']) {
$data['tags'] = $entry['tags'];
}

View File

@ -57,7 +57,7 @@ class FirefoxImport extends BrowserImport
'created_at' => substr($entry['dateAdded'], 0, 10),
];
if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) {
if (array_key_exists('tags', $entry) && '' !== $entry['tags']) {
$data['tags'] = $entry['tags'];
}

View File

@ -206,10 +206,10 @@ class PocketImport extends AbstractImport
$this->fetchContent($entry, $url);
// 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
$entry->setArchived(1 === (int) $importedEntry['status'] || $this->markAsRead);
$entry->setArchived(1 === $importedEntry['status'] || $this->markAsRead);
// 0 or 1 - 1 if the item is starred
$entry->setStarred(1 === (int) $importedEntry['favorite']);
// 0 or 1 - 1 If the item is starred
$entry->setStarred(1 === $importedEntry['favorite']);
$title = 'Untitled';
if (isset($importedEntry['resolved_title']) && '' !== $importedEntry['resolved_title']) {

View File

@ -122,7 +122,7 @@ abstract class WallabagImport extends AbstractImport
// update entry with content (in case fetching failed, the given entry will be return)
$this->fetchContent($entry, $data['url'], $data);
if (\array_key_exists('tags', $data)) {
if (array_key_exists('tags', $data)) {
$this->tagsAssigner->assignTagsToEntry(
$entry,
$data['tags'],

View File

@ -61,7 +61,7 @@ class WallabagV1Import extends WallabagImport
$data['html'] = $this->fetchingErrorMessage;
}
if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) {
if (array_key_exists('tags', $entry) && '' !== $entry['tags']) {
$data['tags'] = $entry['tags'];
}

View File

@ -74,7 +74,7 @@
<table cellpadding="0" cellspacing="0" border="0" align="center" id="card">
<tr>
<td style="padding: 20px;" width="96px" valign="top"><img class="image_fix" src="{{ absolute_url(asset('wallassets/themes/_global/img/logo-square.svg')) }}" alt="logo" title="{{ wallabag_url }}" style="width: 96px; height: 96px;" /></td>
<td style="padding: 20px;" width="96px" valign="top"><img class="image_fix" src="{{ absolute_url(asset('wallassets/themes/_global/img/logo-other_themes.png')) }}" alt="logo" title="{{ wallabag_url }}" style="width: 96px; height: 96px;" /></td>
<td style="padding: 20px; padding-left: 0;" valign="top" id="cell_desc">
<h1>wallabag</h1>
<h5>{{ "auth_code.on"|trans({}, 'wallabag_user') }} {{ wallabag_url }}</h5>

View File

@ -242,15 +242,6 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertSame(2, $content['limit']);
}
public function testGetStarredEntriesWithBadSort()
{
$this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated', 'order' => 'unknown']);
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
$this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type'));
}
public function testGetStarredEntries()
{
$this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']);
@ -400,71 +391,29 @@ class EntryRestControllerTest extends WallabagApiTestCase
public function testDeleteEntry()
{
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$entry = new Entry($em->getReference(User::class, 1));
$entry->setUrl('http://0.0.0.0/test-delete-entry');
$entry->setTitle('Test delete entry');
$em->persist($entry);
$em->flush();
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneByUser(1, ['id' => 'asc']);
$em->clear();
if (!$entry) {
$this->markTestSkipped('No content found in db.');
}
$e = [
'title' => $entry->getTitle(),
'url' => $entry->getUrl(),
'id' => $entry->getId(),
];
$this->client->request('DELETE', '/api/entries/' . $e['id'] . '.json');
$this->client->request('DELETE', '/api/entries/' . $entry->getId() . '.json');
$this->assertSame(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertSame($e['title'], $content['title']);
$this->assertSame($e['url'], $content['url']);
$this->assertSame($e['id'], $content['id']);
$this->assertSame($entry->getTitle(), $content['title']);
$this->assertSame($entry->getUrl(), $content['url']);
$this->assertSame($entry->getId(), $content['id']);
// We'll try to delete this entry again
$client = $this->createAuthorizedClient();
$client->request('DELETE', '/api/entries/' . $e['id'] . '.json');
$this->client->request('DELETE', '/api/entries/' . $entry->getId() . '.json');
$this->assertSame(404, $client->getResponse()->getStatusCode());
}
public function testDeleteEntryExpectId()
{
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$entry = new Entry($em->getReference(User::class, 1));
$entry->setUrl('http://0.0.0.0/test-delete-entry-id');
$em->persist($entry);
$em->flush();
$em->clear();
$id = $entry->getId();
$this->client->request('DELETE', '/api/entries/' . $id . '.json?expect=id');
$this->assertSame(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertSame($id, $content['id']);
$this->assertArrayNotHasKey('url', $content);
// We'll try to delete this entry again
$client = $this->createAuthorizedClient();
$client->request('DELETE', '/api/entries/' . $id . '.json');
$this->assertSame(404, $client->getResponse()->getStatusCode());
}
public function testDeleteEntryExpectBadRequest()
{
$this->client->request('DELETE', '/api/entries/1.json?expect=badrequest');
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
$this->assertSame(404, $this->client->getResponse()->getStatusCode());
}
public function testPostEntry()

View File

@ -226,13 +226,6 @@ class PocketImportTest extends TestCase
->method('getRepository')
->willReturn($entryRepo);
$this->em
->expects($this->any())
->method('persist')
->with($this->callback(function ($persistedEntry) {
return $persistedEntry->isArchived() && $persistedEntry->isStarred();
}));
$entry = new Entry($this->user);
$this->contentProxy

File diff suppressed because one or more lines are too long