Compare commits

..

267 Commits

Author SHA1 Message Date
74cbfd945b Merge pull request #8494 from wallabag/release/2.6.14
Prepare 2.6.14
2025-10-07 10:05:47 +02:00
de107deed2 Prepare 2.6.14 2025-10-07 09:49:06 +02:00
7108eea2da Merge pull request #8488 from wallabag/fix/doc-urls-api 2025-10-06 06:05:45 +02:00
7aadb8eaa8 Merge pull request #8332 from andreadecorte/fix-reading-time-computation 2025-10-06 06:05:31 +02:00
f2a3968a2f Merge pull request #8489 from wallabag/fix/bump-deps 2025-10-06 06:04:56 +02:00
19c0b9c800 Bump deps (mostly for siteconfig) 2025-10-02 12:19:53 +02:00
1a69855090 Fix urls parameter when sending many urls to be stored using the API 2025-10-02 10:23:14 +02:00
797d48905c Extract DEFAULT_WORDS_PER_MINUTE in Utils
This is done In order to avoid having magic numbers in the code
2025-09-07 22:32:55 +02:00
d24b703315 Extract user reading time logic in a single place
Extract user reading time computation in a single place under Entry to avoid duplication.

This will also fix reading time computation for short entries.

RuleTagger logic is slightly changed as we will round when filtering, which will be
consistent with frontend display.
2025-09-07 22:27:08 +02:00
1eca3cf327 Merge pull request #8440 from wallabag/fix-docker-base-image
Fix docker base image
2025-08-25 08:55:19 +02:00
91384c531d Fix docker base image 2025-08-24 23:47:18 +02:00
a86b16d679 Merge pull request #8435 from wallabag/update-dependencies
Update dependencies
2025-08-20 15:11:25 +02:00
2bfc3fd852 Update dependencies 2025-08-20 13:04:24 +02:00
653b198f8e Merge pull request #8346 from skn/2.6
Add annotations filter to entries API endpoint
2025-07-11 15:08:08 +02:00
5c5b20c83b Add annotations filter to entries API endpoint
Implement a new filter parameter 'annotations' for the GET /api/entries endpoint
that allows filtering entries based on whether they have annotations. When
annotations=1, only entries with one or more annotations are returned. When
annotations=0, only entries without annotations are returned. This feature
enables users to easily find annotated content through the API.
2025-07-02 22:24:29 +04:00
d00fe83366 Merge pull request #8267 from wallabag/fix/2.6-deprecation
Fix deprecation
2025-06-05 16:32:29 +02:00
f0d3db70c0 Fix deprecation
See https://php.watch/versions/8.2/$%7Bvar%7D-string-interpolation-deprecated
2025-06-05 15:54:51 +02:00
4f34cfa6fc Merge pull request #8251 from wallabag/change-version
Change version in wallabag.yml
2025-06-04 18:48:59 +02:00
8e90c0f320 Change version in wallabag.yml 2025-06-04 17:41:09 +02:00
6ffd7382c7 Merge pull request #8229 from wallabag/prepare-2613
Prepare 2.6.13 release
2025-06-04 17:29:19 +02:00
46d6e4d923 Update CHANGELOG 2025-06-04 13:59:00 +02:00
09af127446 Unlock php-readability 2025-06-04 13:59:00 +02:00
4c23196304 Prepare 2.6.13 release 2025-06-04 13:59:00 +02:00
42746f418e Merge pull request #8250 from wallabag/update-site-config
Update joker/graby-site-config
2025-06-04 13:54:23 +02:00
35c4feedd8 Update joker/graby-site-config 2025-06-04 13:42:08 +02:00
c451cc96e5 Merge pull request #8240 from wallabag/import/pocket-csv
Add support of Pocket CSV import
2025-06-03 13:32:51 +02:00
c4240c866b PocketCsvImport: rework test to ensure we import all entries
This also adds a test for #8217

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2025-06-03 13:24:27 +02:00
27d66d9e1d Add 'application/vnd.ms-excel' to allowed MIME types config
Backport #8036
2025-06-03 13:24:27 +02:00
c1397f43ac Add Pocket CSV import 2025-06-03 13:24:27 +02:00
52a16bb75f Merge pull request #8193 from wallabag/add-pocket-shaarli-import
Backport Pocket and Shaarli imports from master
2025-06-02 14:23:33 +02:00
f82c87b520 import: fix some tests
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2025-06-02 13:42:44 +02:00
772a802596 Merge pull request #8194 from wallabag/fix-8158
Add j0k3r/php-readability:1.2.10 as a dependency
2025-06-01 16:51:35 +02:00
29162bde9d Pin j0k3r/php-readability to 1.2.10
We pin php-readability to 1.2.10 because of a regression in 1.2.12

Workaround for #8151

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2025-06-01 16:37:22 +02:00
b1614e9267 Add Pocket and Shaarli imports 2025-05-24 16:25:48 +02:00
70999075a6 Merge pull request #8139 from wallabag/fix/otp-wrongly-enabled
Avoid non-validated OTP to be enabled
2025-04-14 09:46:17 +02:00
262f674245 Avoid non-validated OTP to be enabled
The OTP code must be required when enabling OTP. If the provided code is wrong, disable OTP, redirect and notice the user.
2025-04-14 09:18:37 +02:00
01ffc6c3d5 Merge pull request #8137 from wallabag/prepare-2.6.12-release
Prepare 2.6.12 release
2025-04-10 11:59:57 +02:00
5586930376 Prepare 2.6.12 release 2025-04-10 11:39:50 +02:00
b45116b73e Merge pull request #8136 from wallabag/update-dependencies
Update dependencies
2025-04-10 11:32:25 +02:00
c2e38cedac Update dependencies 2025-04-10 11:22:33 +02:00
35dcc43366 Merge pull request #8135 from wallabag/fix-changelog
Fix changelog
2025-04-10 11:10:58 +02:00
de8f859536 Fix changelog 2025-04-10 10:59:31 +02:00
5cdac6c0bb Merge pull request #8133 from wallabag/prepare-2.6.11-release
Prepare 2.6.11 release
2025-04-08 22:42:32 +02:00
466cd17d5b Prepare 2.6.11 release 2025-04-08 21:23:58 +02:00
14cdd123ce Update generated assets 2025-04-08 21:23:58 +02:00
bdb420b13f Use ubuntu latest in all jobs 2025-04-08 21:16:07 +02:00
99c8a06594 Merge commit from fork
Protect actions with a CSRF token
2025-04-08 21:00:14 +02:00
4c52f71895 Add SameSite=lax to session cookie 2025-03-30 06:18:32 +02:00
677b2986bc Use 400 Bad Request errors for invalid CSRF everywhere 2025-03-30 06:18:32 +02:00
5ea5115a72 Protect mass_action with a CSRF token 2025-03-30 06:18:32 +02:00
27f0d94db7 Protect tag_delete with a CSRF token 2025-03-30 06:18:32 +02:00
cf49be6940 Protect tag_this_search with a CSRF token 2025-03-30 06:18:32 +02:00
ddf2e80842 Protect remove_tag with a CSRF token 2025-03-30 06:18:32 +02:00
d1e128900a Protect delete_share with a CSRF token 2025-03-30 06:18:32 +02:00
0d8429dfc7 Protect share with a CSRF token 2025-03-30 06:18:32 +02:00
eb8408b22f Protect delete_entry with a CSRF token 2025-03-30 06:18:32 +02:00
00d0e6f951 Protect star_entry with a CSRF token 2025-03-30 06:18:32 +02:00
edffef8375 Protect archive_entry with a CSRF token 2025-03-30 06:18:32 +02:00
3817010e29 Protect reload_entry with a CSRF token 2025-03-30 06:18:32 +02:00
ed1acf59e1 Protect changeLocale with a CSRF token 2025-03-30 06:18:29 +02:00
e162408139 Protect switch_view_mode with a CSRF token 2025-03-23 19:13:21 +01:00
6fa61c0f9c Protect delete_ignore_origin_rule with a CSRF token 2025-03-23 19:13:17 +01:00
264f91126e Protect delete_tagging_rule with a CSRF token 2025-03-23 19:13:14 +01:00
ac5b5fb379 Protect revoke_token with a CSRF token 2025-03-23 19:13:09 +01:00
d703fa6a3a Protect generate_token with a CSRF token 2025-03-23 19:13:06 +01:00
f71d8332e0 Merge pull request #7999 from wallabag/fix/menu-entry-with-annotations
Fix entries counter for annotated entries in the menu
2025-02-10 10:12:45 +01:00
3dffcadc03 Fix entries counter for annotated entries in the menu
The query were badly made and return all annotations for the current user instead of the total of entries with annotation(s).
2025-02-10 08:42:06 +01:00
fab0c02ba0 Merge pull request #7993 from wallabag/fix/pocket-api-import 2025-02-07 21:26:07 +01:00
c4857564f3 Change NB_ELEMENTS in pocket importer to 30 to comply with Pocket API restriction. 2025-02-07 18:51:37 +01:00
c7c74de4b8 Merge pull request #7846 from wallabag/fix-title-tag-filter
Fix title tag filter
2024-11-22 14:05:14 +01:00
08b68d4d87 Display tag label instead of tag slug in page title 2024-11-22 13:49:08 +01:00
93e877f086 Merge pull request #7827 from wallabag/fix-redirection-action-search
Fix redirection after action in search results
2024-11-21 13:57:12 +01:00
82430b50c6 Fix redirection after action in search results 2024-11-21 13:36:20 +01:00
89db5690a0 Merge pull request #7767 from wallabag/prepare-2610
Prepare 2.6.10 release
2024-11-03 16:00:31 +01:00
d4171e9d63 Prepare 2.6.10 release 2024-11-03 08:05:50 +01:00
74175f2e54 Merge pull request #7754 from wallabag/add-omnivore-import
Added Omnivore Import
2024-11-01 11:11:12 +01:00
bd8ccf924f Added Omnivore Import 2024-11-01 11:05:16 +01:00
1cc321bec4 Merge pull request #7753 from wallabag/replace-gitter
Replaced gitter with matrix
2024-10-31 16:19:16 +01:00
048221dbcf Removed uncertain translations 2024-10-31 12:47:19 +01:00
7ddf5066ef Replaced gitter with matrix 2024-10-31 08:17:40 +01:00
5d13648420 Merge pull request #7624 from wallabag/prepare-2.6.10
Prepare 2.6.10
2024-08-19 08:05:06 +02:00
f2c72e1569 Prepare 2.6.10 2024-08-19 07:28:28 +02:00
5ac6788715 Merge pull request #7623 from wallabag/update-site-config
Update site config
2024-08-19 07:16:46 +02:00
d757612c77 Update site config 2024-08-17 22:16:29 +02:00
b6faa844cb Merge pull request #7582 from wallabag/fix/2.6-site-config
Update site config & tests
2024-07-15 17:14:15 +02:00
898890c371 Fix tests 2024-07-15 13:11:18 +02:00
580c5fe810 Downgrade lcobucci/jwt because of auth problem 2024-07-15 10:54:21 +02:00
bee59d1c4a Update site config 2024-07-15 10:44:49 +02:00
f8f7f962ce Merge pull request #7395 from wallabag/release/2.6.9
Prepare 2.6.9
2024-04-03 10:56:40 +02:00
54ba9a6da8 Prepare 2.6.9
Also update deps.
2024-04-03 09:26:58 +02:00
8cceb89261 Merge pull request #7323 from wallabag/fix/2.6-elcurator-how-to
Use a proper "how to" for elCurator
2024-03-08 09:35:04 +01:00
09c2ddb79e Use a proper "how to" for elCurator 2024-03-05 15:46:40 +01:00
7246b4c1db Merge pull request #7272 from yguedidi/upgrade-php-dependencies
Upgrade PHP dependencies
2024-02-19 11:27:08 +01:00
87ce9fd48d Normalize composer.json 2024-02-19 11:08:46 +01:00
db55cfbc0a Bump dependencies 2024-02-19 11:05:25 +01:00
3e18b66e62 Upgrade PHP dependencies 2024-02-19 11:04:17 +01:00
bc16155ec2 Merge pull request #7266 from yguedidi/fix-same-domain-pagination
Fix same domain pagination
2024-02-19 07:03:08 +01:00
a4820b21ca Fix same domain pagination 2024-02-18 23:29:59 +01:00
3d26ddde88 Merge pull request #7143 from wallabag/release/2.6.8
Prepare 2.6.8 release
2024-01-03 08:24:57 +01:00
c8f036ad0f Prepare 2.6.8 release 2024-01-03 07:31:07 +01:00
5e89fc2606 Merge pull request #7140 from yguedidi/remove-session-based-redirection
Remove session-based redirection
2024-01-02 23:39:10 +01:00
9bef459882 Make Redirect helper supports only absolute path reference URLs 2023-12-28 21:48:48 +01:00
7ebc96f3b9 Remove session-based redirection 2023-12-28 21:42:26 +01:00
f4493f7472 Remove support for fallback in Redirect helper 2023-12-28 21:42:12 +01:00
ffec47bd88 Use Redirect helper in ConfigController::changeViewModeAction 2023-12-28 21:26:30 +01:00
4a8fb78c7c Merge pull request #7141 from yguedidi/fix-docker-setup
Fix docker setup
2023-12-27 19:24:21 +01:00
967f8fa495 Fix docker setup 2023-12-27 19:18:54 +01:00
3a7e597ffc Merge pull request #7142 from yguedidi/make-database-dependent-commands-lazy
Make database dependent commands lazy
2023-12-27 19:08:18 +01:00
9927a06cab Make database dependent commands lazy 2023-12-26 21:29:00 +01:00
d6c401423f Merge pull request #7133 from Simounet/fix/dark-mode-disabled-url-2.6 2023-12-22 20:43:28 +01:00
6725228ed5 Assets generation 2023-12-22 15:29:06 +01:00
165973d834 Fix add tags input dark mode 2023-12-22 15:01:23 +01:00
e018daf2fa Fix disabled URL edit dark mode 2023-12-22 15:01:23 +01:00
902edbfeb6 Merge pull request #7134 from wallabag/fix/2.6-update-deps
Update deps & Node 20
2023-12-22 14:59:13 +01:00
75f6f53d25 Update GitHub Actions 2023-12-22 14:45:23 +01:00
cc17b3acaf Update deps
Mostly to free `symfony/phpunit-bridge`.

Also raise minimum version of node to 20, v16 is unmaintained since October 2023.
2023-12-22 14:41:05 +01:00
60623246ae Merge pull request #7006 from wallabag/release/2.6.7
Prepare 2.6.7 release
2023-10-02 14:21:29 +02:00
fa107116cc Prepare 2.6.7 release 2023-10-02 14:14:34 +02:00
0cfdddc2eb Merge pull request from GHSA-56fm-hfp3-x3w3
Fix CSRF Vulnerability on 2FA endpoints
2023-10-02 13:51:41 +02:00
aa06e8328e ConfigController: remove 2fa cancel step
This change annoys me, however this endpoint was anyway problematic:
- it was vulnerable to a CSRF attack, see GHSA-56fm-hfp3-x3w3
- it is useless as we don't really handle a two-steps validation

Still, if you send an incorrect code during the "activation" phase a
flash error will pop up but the 2fa will stay enabled. This need rework
when possible.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-09-30 00:49:58 +02:00
5240684be9 ConfigController: move OTP endpoints to POST method only
Fixes GHSA-56fm-hfp3-x3w3

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-09-30 00:49:58 +02:00
9ec351e8b6 Merge pull request #6986 from Simounet/feat/entry-tag-form-button
Add tag form submit button always displayed
2023-09-29 16:38:54 +02:00
6fab27f3ce Add tag form submit button always displayed 2023-09-29 15:35:33 +02:00
e4d69cafe4 Merge pull request #6991 from Simounet/feat/6971-mass-action-click-full-card
Fix #6971 - Full clickable card on mass action
2023-09-29 14:53:27 +02:00
34e51243d9 Merge pull request #6985 from Simounet/fix/tag-controller-null-value 2023-09-27 22:36:36 +02:00
9bc026f343 Fix #6971 - Full clickable card on mass action 2023-09-27 19:25:16 +02:00
a46fd5fc9f Fix deprecated null parameter passed to explode() 2023-09-26 18:02:46 +02:00
f06a826c6d Merge pull request #6926 from wallabag/release/2.6.6
Prepare 2.6.6 release
2023-09-07 09:26:33 +02:00
c7e5ba6dd0 Prepare 2.6.6 release 2023-09-07 09:18:56 +02:00
62ab325ad4 Merge pull request #6924 from wallabag/fix/secure-cookie
Force secure cookie on HTTPS connection
2023-09-06 12:45:23 +02:00
c5d21025c4 Force secure cookie on HTTPS connection 2023-09-06 12:39:40 +02:00
8ac80e934e Merge pull request #6912 from Simounet/feat/tag-mass-action-improved
Mass action layout improved
2023-09-04 13:25:05 +02:00
4b04cd5746 Mass action tag layout updated 2023-09-04 12:00:16 +02:00
dbed27f8d8 Merge pull request #6909 from Simounet/feat/homepage-perfs
Improve performance on homepage
2023-09-01 14:13:31 +02:00
137c8ab756 Count queries simplified 2023-09-01 11:53:44 +02:00
0fdffb0b96 Homepage form header layout updated 2023-08-31 22:26:08 +02:00
2d7d16ee6c Tag mass action layout updated 2023-09-01 14:16:27 +02:00
18615738c0 Title removed from footer's stats element 2023-08-31 12:34:36 +02:00
452362c17a Untagged entries number removed from the filter's sidebar 2023-08-31 12:34:36 +02:00
ec4d23b584 Merge pull request #6899 from wallabag/fix/google-mailer
Add Google mailer
2023-08-29 09:34:39 +02:00
c0414355aa Merge pull request #6897 from Simounet/fix/checkboxes-pointer-events-bis
Fix checkboxes pointer events issue
2023-08-28 18:01:48 +02:00
aaf4ab2d2a Add Google mailer
SMTP is the default provider to send email.
But users tend to use Gmail from time to time. So, instead of a complex installation to allow it, we prefer to ship it with the default package.

Also:
- update deps globally
- lock symfony/* deps to 4.4
2023-08-28 18:01:09 +02:00
56983b01a8 Fix checkboxes pointer events issue 2023-08-28 14:21:34 +02:00
6b7e9ec1df Merge pull request #6896 from wallabag/prepare-265
Prepare wallabag 2.6.5
2023-08-28 10:22:14 +02:00
f052f6f580 Prepare wallabag 2.6.5 2023-08-28 10:14:40 +02:00
16a92c54a7 Update j0k3r/graby-site-config 2023-08-28 10:08:09 +02:00
13b2752e8d Autocapitalize disabled for domain input filter 2023-08-28 09:54:51 +02:00
634997c9b5 Good HTML type for HTTP status input filter 2023-08-28 09:54:45 +02:00
ca608ece65 Fix nav input styles 2023-08-28 09:54:12 +02:00
027042cc1a Fix #6873 override materializecss checkbox pointer-events disabled 2023-08-28 09:53:56 +02:00
cf9243151a Merge pull request #6871 from wallabag/prepare-264
Prepare wallabag 2.6.4
2023-08-22 15:43:27 +02:00
e9a837a0ac Prepare wallabag 2.6.4 2023-08-22 15:37:04 +02:00
abef36fd2b Merge pull request #6869 from wallabag/fix-api-token
Fix API token generation
2023-08-22 15:32:39 +02:00
2f86dd9c73 Fix API token generation 2023-08-22 13:35:27 +02:00
3d22442f8c Merge pull request #6864 from wallabag/fix-checkbox
Fix checkboxes which were broken
2023-08-21 15:34:58 +02:00
c99a733aff Fix checkboxes which were broken 2023-08-21 14:12:06 +02:00
85065b509f Merge pull request #6862 from wallabag/prepare-263
Prepare wallabag 2.6.3
2023-08-21 11:57:10 +02:00
ca879c36de Prepare wallabag 2.6.3 2023-08-21 11:52:16 +02:00
ffcc5c9062 Merge pull request from GHSA-gjvc-55fw-v6vq
Replace GET way to POST way to delete API client
2023-08-21 11:08:47 +02:00
78b0b55c40 Merge pull request from GHSA-p8gp-899c-jvq9
Replace GET way to POST way to reset data user
2023-08-21 11:08:24 +02:00
94a6bc0dad Merge pull request #6806 from wallabag/dependabot/composer/craue/config-bundle-2.7.0
Bump craue/config-bundle from 2.6.0 to 2.7.0
2023-08-21 10:57:10 +02:00
383dcc5c45 Merge pull request #6119 from Spoons/feat_referer_to_session_redirect
Fix: Use Session instead of Referrer for Redirection
2023-08-21 10:32:03 +02:00
de5aa004cb Bump craue/config-bundle from 2.6.0 to 2.7.0
Bumps [craue/config-bundle](https://github.com/craue/CraueConfigBundle) from 2.6.0 to 2.7.0.
- [Changelog](https://github.com/craue/CraueConfigBundle/blob/master/CHANGELOG.md)
- [Commits](https://github.com/craue/CraueConfigBundle/compare/2.6.0...2.7.0)

---
updated-dependencies:
- dependency-name: craue/config-bundle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 09:38:54 +02:00
dca910e2a6 Merge pull request #6860 from wallabag/dependabot/npm_and_yarn/sass-1.66.1
Bump sass from 1.65.1 to 1.66.1
2023-08-21 03:08:38 +00:00
bc491e3712 Bump sass from 1.65.1 to 1.66.1
Bumps [sass](https://github.com/sass/dart-sass) from 1.65.1 to 1.66.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.65.1...1.66.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 03:01:00 +00:00
40d7ca11da Merge pull request #6859 from wallabag/dependabot/npm_and_yarn/postcss-scss-4.0.7
Bump postcss-scss from 4.0.6 to 4.0.7
2023-08-21 02:59:43 +00:00
89d38b23e0 Merge pull request #6861 from wallabag/dependabot/npm_and_yarn/stylelint-15.10.3
Bump stylelint from 15.10.2 to 15.10.3
2023-08-21 02:57:59 +00:00
7be1a4e1b2 Merge pull request #6858 from wallabag/dependabot/npm_and_yarn/eslint-plugin-import-2.28.1
Bump eslint-plugin-import from 2.28.0 to 2.28.1
2023-08-21 02:44:22 +00:00
4d890868ed Bump postcss-scss from 4.0.6 to 4.0.7
Bumps [postcss-scss](https://github.com/postcss/postcss-scss) from 4.0.6 to 4.0.7.
- [Changelog](https://github.com/postcss/postcss-scss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss-scss/compare/4.0.6...4.0.7)

---
updated-dependencies:
- dependency-name: postcss-scss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 02:42:50 +00:00
1d0200c5b9 Bump stylelint from 15.10.2 to 15.10.3
Bumps [stylelint](https://github.com/stylelint/stylelint) from 15.10.2 to 15.10.3.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/15.10.2...15.10.3)

---
updated-dependencies:
- dependency-name: stylelint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 02:42:47 +00:00
6a5e7dba89 Merge pull request #6857 from wallabag/dependabot/npm_and_yarn/postcss-8.4.28
Bump postcss from 8.4.27 to 8.4.28
2023-08-21 02:41:38 +00:00
6f23eba62d Bump eslint-plugin-import from 2.28.0 to 2.28.1
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.28.0 to 2.28.1.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.28.0...v2.28.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 02:36:30 +00:00
d87237484c Bump postcss from 8.4.27 to 8.4.28
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.27 to 8.4.28.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.27...8.4.28)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 02:36:22 +00:00
46ebbfc9a4 Merge pull request #6788 from wallabag/add-git-check
Add check if git is installed
2023-08-19 16:11:11 +02:00
8ee95437a0 Fix typo 2023-08-19 07:18:13 +02:00
ef5b43f55c Add check if git is installed
Fix #3589
2023-08-19 07:17:06 +02:00
a465db607f Merge pull request #6842 from wallabag/dependabot/npm_and_yarn/eslint-8.47.0
Bump eslint from 8.46.0 to 8.47.0
2023-08-14 03:36:07 +00:00
985c7add1d Bump eslint from 8.46.0 to 8.47.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.46.0 to 8.47.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.46.0...v8.47.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 03:30:45 +00:00
3d9986d6fc Merge pull request #6841 from wallabag/dependabot/npm_and_yarn/babel/core-7.22.10
Bump @babel/core from 7.22.9 to 7.22.10
2023-08-14 03:29:22 +00:00
4b7a6eaf39 Bump @babel/core from 7.22.9 to 7.22.10
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.9 to 7.22.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.22.10/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 03:20:56 +00:00
3e8cc92dcd Merge pull request #6844 from wallabag/dependabot/npm_and_yarn/autoprefixer-10.4.15
Bump autoprefixer from 10.4.14 to 10.4.15
2023-08-14 03:19:49 +00:00
6172071a64 Bump autoprefixer from 10.4.14 to 10.4.15
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.14 to 10.4.15.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.14...10.4.15)

---
updated-dependencies:
- dependency-name: autoprefixer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 03:10:09 +00:00
cf3adbfaea Merge pull request #6845 from wallabag/dependabot/npm_and_yarn/babel/preset-env-7.22.10
Bump @babel/preset-env from 7.22.9 to 7.22.10
2023-08-14 03:08:59 +00:00
24e6311c05 Merge pull request #6843 from wallabag/dependabot/npm_and_yarn/stylelint-scss-5.1.0
Bump stylelint-scss from 5.0.1 to 5.1.0
2023-08-14 02:59:06 +00:00
69b96fe179 Bump @babel/preset-env from 7.22.9 to 7.22.10
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.22.9 to 7.22.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.22.10/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 02:51:35 +00:00
ffa2e68c5f Merge pull request #6840 from wallabag/dependabot/npm_and_yarn/babel/eslint-parser-7.22.10
Bump @babel/eslint-parser from 7.22.9 to 7.22.10
2023-08-14 02:50:24 +00:00
b338c68945 Merge pull request #6839 from wallabag/dependabot/npm_and_yarn/sass-1.65.1
Bump sass from 1.64.2 to 1.65.1
2023-08-14 02:47:30 +00:00
f67486a6df Bump stylelint-scss from 5.0.1 to 5.1.0
Bumps [stylelint-scss](https://github.com/stylelint-scss/stylelint-scss) from 5.0.1 to 5.1.0.
- [Release notes](https://github.com/stylelint-scss/stylelint-scss/releases)
- [Changelog](https://github.com/stylelint-scss/stylelint-scss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stylelint-scss/stylelint-scss/compare/v5.0.1...v5.1.0)

---
updated-dependencies:
- dependency-name: stylelint-scss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 02:43:55 +00:00
33c72bb9fc Bump @babel/eslint-parser from 7.22.9 to 7.22.10
Bumps [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) from 7.22.9 to 7.22.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.22.10/eslint/babel-eslint-parser)

---
updated-dependencies:
- dependency-name: "@babel/eslint-parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 02:43:07 +00:00
78dc311c72 Bump sass from 1.64.2 to 1.65.1
Bumps [sass](https://github.com/sass/dart-sass) from 1.64.2 to 1.65.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.64.2...1.65.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 02:42:52 +00:00
48226ad6e5 Merge pull request #6809 from yguedidi/replace-kernel.root_dir-by-kernel.project_dir
Replace kernel.root_dir by kernel.project_dir
2023-08-13 20:02:06 +02:00
f33d1f8e48 Merge pull request #6829 from wallabag/impr/css-content
css: reduce risk of collision for #content
2023-08-13 18:03:17 +02:00
97810f7335 css: rebuild assets
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-08-13 00:09:59 +02:00
15230f488a css: reduce risk of collision for #content
`main #content` can match fetched content and break the layout, like for
technologyreview.com

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-08-13 00:08:39 +02:00
89ca32e705 Merge pull request #6817 from yguedidi/split-symfony/symfony
Split symfony/symfony
2023-08-11 22:03:53 +02:00
a71d95e38a Merge pull request #6826 from weblate/weblate-wallabag-messages
Translations update from Hosted Weblate
2023-08-11 20:55:44 +02:00
fa2e1d933f Translated using Weblate (Croatian)
Currently translated at 100.0% (582 of 582 strings)
2023-08-11 14:47:40 +02:00
181fe7e1e9 Translated using Weblate (Polish)
Currently translated at 100.0% (582 of 582 strings)
2023-08-11 14:47:39 +02:00
905d61eb49 Merge pull request #6824 from wallabag/dependabot/composer/doctrine/orm-2.16.1
Bump doctrine/orm from 2.15.4 to 2.16.1
2023-08-10 08:07:08 +02:00
c78f2706c9 Bump doctrine/orm from 2.15.4 to 2.16.1
Bumps [doctrine/orm](https://github.com/doctrine/orm) from 2.15.4 to 2.16.1.
- [Release notes](https://github.com/doctrine/orm/releases)
- [Commits](https://github.com/doctrine/orm/compare/2.15.4...2.16.1)

---
updated-dependencies:
- dependency-name: doctrine/orm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-10 07:57:48 +02:00
dbbb5f3cfb Merge pull request #6825 from wallabag/dependabot/composer/phpstan/phpstan-doctrine-1.3.42
Bump phpstan/phpstan-doctrine from 1.3.41 to 1.3.42
2023-08-10 07:57:27 +02:00
33d22c149b Bump phpstan/phpstan-doctrine from 1.3.41 to 1.3.42
Bumps [phpstan/phpstan-doctrine](https://github.com/phpstan/phpstan-doctrine) from 1.3.41 to 1.3.42.
- [Release notes](https://github.com/phpstan/phpstan-doctrine/releases)
- [Commits](https://github.com/phpstan/phpstan-doctrine/compare/1.3.41...1.3.42)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-doctrine
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-10 02:06:55 +00:00
cc33fcb4ba Replace kernel.root_dir by kernel.project_dir 2023-08-09 22:46:18 +01:00
24db3d6862 Split symfony/symfony 2023-08-09 21:51:49 +01:00
c3d1f92278 Replace GET way to POST way to delete API client 2023-08-09 21:54:40 +02:00
a9893d754f Replace GET way to POST way to reset data user
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-08-09 21:39:03 +02:00
f4fd8e4675 Merge pull request #6778 from wallabag/add-confirmation-before-reload
Add confirmation before reload entry
2023-08-09 19:40:49 +02:00
0ccbd653fa Merge pull request #6812 from yguedidi/make-crawler-extract-get-an-array
Make Crawler::extract get an array
2023-08-09 11:03:03 +02:00
70452cfc3f Merge pull request #6820 from wallabag/dependabot/composer/phpstan/phpstan-doctrine-1.3.41
Bump phpstan/phpstan-doctrine from 1.3.40 to 1.3.41
2023-08-09 07:54:32 +02:00
826e310687 Bump phpstan/phpstan-doctrine from 1.3.40 to 1.3.41
Bumps [phpstan/phpstan-doctrine](https://github.com/phpstan/phpstan-doctrine) from 1.3.40 to 1.3.41.
- [Release notes](https://github.com/phpstan/phpstan-doctrine/releases)
- [Commits](https://github.com/phpstan/phpstan-doctrine/compare/1.3.40...1.3.41)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-doctrine
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-09 07:45:44 +02:00
b81054697b Merge pull request #6819 from wallabag/dependabot/composer/phpstan/phpstan-1.10.28
Bump phpstan/phpstan from 1.10.27 to 1.10.28
2023-08-09 07:45:15 +02:00
ddd8754a11 Bump phpstan/phpstan from 1.10.27 to 1.10.28
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.27 to 1.10.28.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.27...1.10.28)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-09 02:24:32 +00:00
ac1c1ff571 Merge pull request #6816 from yguedidi/use-psr-17-and-psr-18
Use PSR-17 and PSR-18
2023-08-08 23:56:10 +02:00
815158fefa Merge pull request #6813 from yguedidi/replace-client-by-kernelbrowser
Replace Client by KernelBrowser
2023-08-08 23:36:06 +02:00
e1928c78ff Merge pull request #6810 from yguedidi/replace-debug-component-by-errorhandler-component
Replace Debug component by ErrorHandler component
2023-08-08 23:28:13 +02:00
65915004e0 Merge pull request #6808 from yguedidi/make-importcontroller-extends-abstractcontroller
Make ImportController extends AbstractController
2023-08-08 23:26:37 +02:00
60cb8c0294 Merge pull request #6797 from yguedidi/use-twig-instead-of-templating
Use Twig instead of templating
2023-08-08 23:18:16 +02:00
f6e85e88af Merge pull request #6799 from yguedidi/identify-platforms-by-their-class
Identify platforms by their class
2023-08-08 23:04:42 +02:00
a4b0a01b6d Merge pull request #6798 from yguedidi/add-mandatory-$class-parameter
Add mandatory $class parameter
2023-08-08 22:59:16 +02:00
1bed15fd9b Merge pull request #6800 from yguedidi/move-from-transchoice-to-trans
Move from transchoice to trans
2023-08-08 22:57:48 +02:00
59860d9526 Merge pull request #6794 from wallabag/dependabot/composer/guzzlehttp/psr7-2.6.0
Bump guzzlehttp/psr7 from 2.5.0 to 2.6.0
2023-08-08 16:54:46 +02:00
807d473564 Merge pull request #6811 from yguedidi/replace-getresponseevent-by-requestevent
Replace GetResponseEvent by RequestEvent
2023-08-08 16:53:18 +02:00
ed17e61db2 Merge pull request #6803 from yguedidi/ensure-the-kernel-is-shut-down-before-calling-createclient
Ensure the kernel is shut down before calling createClient
2023-08-08 16:51:44 +02:00
6159c92f27 Merge pull request #6814 from yguedidi/ignore-docker-compose.override.yml
Ignore docker-compose.override.yml
2023-08-08 08:17:42 +02:00
bf176121c4 Use PSR-17 and PSR-18 2023-08-08 03:25:27 +01:00
ec33ec14e5 Replace Client by KernelBrowser 2023-08-08 02:55:35 +01:00
2aa7e7e121 Ignore docker-compose.override.yml 2023-08-08 01:35:52 +01:00
093003d9af Make Crawler::extract get an array 2023-08-07 22:51:18 +01:00
58a0ca2622 Replace GetResponseEvent by RequestEvent 2023-08-07 22:34:47 +01:00
1ba1ed23f1 Replace Debug component by ErrorHandler component 2023-08-07 22:29:48 +01:00
7beb535b7a Make ImportController extends AbstractController 2023-08-07 22:04:13 +01:00
9870785d59 Merge pull request #6805 from wallabag/dependabot/composer/phpstan/phpstan-1.10.27
Bump phpstan/phpstan from 1.10.26 to 1.10.27
2023-08-07 07:08:51 +02:00
53a2874351 Bump phpstan/phpstan from 1.10.26 to 1.10.27
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.26 to 1.10.27.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.11.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.26...1.10.27)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-07 02:27:25 +00:00
bb6b9f9f05 Merge pull request #6804 from wallabag/dependabot/npm_and_yarn/sass-1.64.2
Bump sass from 1.64.1 to 1.64.2
2023-08-07 02:25:08 +00:00
526ef23e1a Bump sass from 1.64.1 to 1.64.2
Bumps [sass](https://github.com/sass/dart-sass) from 1.64.1 to 1.64.2.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.64.1...1.64.2)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-07 02:19:52 +00:00
8d3d916d4a Remove extraneous blank lines from EntryController.php 2023-08-06 15:48:28 -05:00
e90daf0690 Update TagController.php 2023-08-06 20:20:35 +00:00
9729db75de Update EntryController.php 2023-08-06 20:19:49 +00:00
ced2ea4015 Merge branch 'master' into feat_referer_to_session_redirect 2023-08-06 20:14:44 +00:00
7d78e2ae06 Ensure the kernel is shut down before calling createClient 2023-08-06 13:48:53 +01:00
f43d8fa947 Move from transchoice to trans 2023-08-05 23:39:13 +01:00
f48f982025 Identify platforms by their class 2023-08-05 18:35:09 +01:00
667ea14d42 Add mandatory $class parameter 2023-08-05 17:25:03 +01:00
e93fdca2d3 Use Twig instead of templating 2023-08-05 16:43:36 +01:00
fcf6d3c3f8 Bump guzzlehttp/psr7 from 2.5.0 to 2.6.0
Bumps [guzzlehttp/psr7](https://github.com/guzzle/psr7) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/guzzle/psr7/releases)
- [Changelog](https://github.com/guzzle/psr7/blob/2.6/CHANGELOG.md)
- [Commits](https://github.com/guzzle/psr7/compare/2.5.0...2.6.0)

---
updated-dependencies:
- dependency-name: guzzlehttp/psr7
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-04 02:40:33 +00:00
c2bfc0f359 Merge pull request #6786 from wallabag/dependabot/composer/sentry/sentry-symfony-4.10.0
Bump sentry/sentry-symfony from 4.9.2 to 4.10.0
2023-08-03 11:26:02 +02:00
8281920f2c Merge pull request #6775 from viktoriussuwandi/issue#6772
Remove external dependencies on src/Wallabag/CoreBundle/Resources/vie…
2023-08-02 23:14:13 +02:00
d4913c50c2 Bump sentry/sentry-symfony from 4.9.2 to 4.10.0
Bumps [sentry/sentry-symfony](https://github.com/getsentry/sentry-symfony) from 4.9.2 to 4.10.0.
- [Release notes](https://github.com/getsentry/sentry-symfony/releases)
- [Changelog](https://github.com/getsentry/sentry-symfony/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-symfony/compare/4.9.2...4.10.0)

---
updated-dependencies:
- dependency-name: sentry/sentry-symfony
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-02 02:10:33 +00:00
19d3e878cf Merge branch 'master' into issue#6772 2023-08-01 19:43:37 +07:00
c659a42c51 Merge pull request #6783 from wallabag/fix-dependencies
Update dependencies
2023-07-31 15:38:43 +02:00
cb411e8dcd Update dependencies 2023-07-31 14:58:29 +02:00
fec8a993d9 Merge pull request #6779 from wallabag/dependabot/composer/jms/serializer-3.27.0
Bump jms/serializer from 3.26.0 to 3.27.0
2023-07-31 11:46:58 +02:00
31542bc4b1 Merge branch 'master' into dependabot/composer/jms/serializer-3.27.0 2023-07-31 11:36:39 +02:00
827dded754 Merge pull request #6780 from wallabag/dependabot/composer/symfony/phpunit-bridge-6.3.2
Bump symfony/phpunit-bridge from 6.3.1 to 6.3.2
2023-07-31 11:36:18 +02:00
39bcddfd8b Merge branch 'master' into dependabot/composer/symfony/phpunit-bridge-6.3.2 2023-07-31 11:29:08 +02:00
8cfa1cd551 Merge pull request #6782 from wallabag/dependabot/npm_and_yarn/eslint-8.46.0
Bump eslint from 8.45.0 to 8.46.0
2023-07-31 02:38:17 +00:00
649e1e56a9 Bump eslint from 8.45.0 to 8.46.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.45.0 to 8.46.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.46.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 02:33:21 +00:00
c1ed66aad5 Merge pull request #6781 from wallabag/dependabot/npm_and_yarn/eslint-plugin-import-2.28.0
Bump eslint-plugin-import from 2.27.5 to 2.28.0
2023-07-31 02:32:20 +00:00
9beadfde59 Bump eslint-plugin-import from 2.27.5 to 2.28.0
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.27.5 to 2.28.0.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.27.5...v2.28.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 02:27:52 +00:00
090f873ffc Bump symfony/phpunit-bridge from 6.3.1 to 6.3.2
Bumps [symfony/phpunit-bridge](https://github.com/symfony/phpunit-bridge) from 6.3.1 to 6.3.2.
- [Release notes](https://github.com/symfony/phpunit-bridge/releases)
- [Changelog](https://github.com/symfony/phpunit-bridge/blob/6.3/CHANGELOG.md)
- [Commits](https://github.com/symfony/phpunit-bridge/compare/v6.3.1...v6.3.2)

---
updated-dependencies:
- dependency-name: symfony/phpunit-bridge
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 02:14:05 +00:00
1b7d756be0 Bump jms/serializer from 3.26.0 to 3.27.0
Bumps [jms/serializer](https://github.com/schmittjoh/serializer) from 3.26.0 to 3.27.0.
- [Release notes](https://github.com/schmittjoh/serializer/releases)
- [Changelog](https://github.com/schmittjoh/serializer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/schmittjoh/serializer/compare/3.26.0...3.27.0)

---
updated-dependencies:
- dependency-name: jms/serializer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-31 02:13:54 +00:00
d6f63d5d51 Add confirmation before reload entry 2023-07-30 20:07:24 +02:00
c1cba72a19 Replace hardcoded url by current wallabag url 2023-07-30 10:09:54 +02:00
e80a169435 Remove external dependencies on src/Wallabag/CoreBundle/Resources/views/Developer/howto_app.html.twig 2023-07-30 14:07:45 +07:00
97fee36fa6 Update src/Wallabag/CoreBundle/Controller/TagController.php
Co-authored-by: Jérémy Benoist <j0k3r@users.noreply.github.com>
2022-12-23 11:03:25 -06:00
fbccae8a79 fix: update remove tag test to accept root relative urls 2022-12-10 11:52:18 -06:00
13bd448e01 feat: use session instead of referer for redirects 2022-12-04 16:20:11 -06:00
179 changed files with 12567 additions and 3865 deletions

View File

@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Want to ask something?
url: https://gitter.im/wallabag/wallabag
about: Use Gitter to ask questions.
url: https://matrix.to/#/#wallabag:matrix.org
about: Use Matrix to ask questions.

View File

@ -5,7 +5,7 @@ on:
push:
branches:
- master
- 2.*
- "2.**"
permissions:
contents: read
@ -13,16 +13,16 @@ permissions:
jobs:
js:
name: "Building assets"
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "Install Node"
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "16"
node-version-file: ".nvmrc"
- name: "Install dependencies with Yarn"
run: "yarn install"

View File

@ -5,7 +5,7 @@ on:
push:
branches:
- master
- 2.*
- "2.**"
permissions:
contents: read
@ -13,11 +13,11 @@ permissions:
jobs:
coding-standards:
name: "CS Fixer, PHPStan & TwigCS"
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"

View File

@ -5,7 +5,7 @@ on:
push:
branches:
- master
- 2.*
- "2.**"
env:
PGPASSWORD: wallabagrocks
@ -14,7 +14,7 @@ env:
jobs:
phpunit:
name: "PHP ${{ matrix.php }} using ${{ matrix.database }}"
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3-alpine
@ -40,7 +40,7 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
@ -83,7 +83,7 @@ jobs:
phpunit_no_prefix:
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without prefix"
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3-alpine
@ -106,7 +106,7 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
@ -151,58 +151,3 @@ jobs:
- name: "Run PHPUnit"
run: "php bin/simple-phpunit -v"
phpunit_no_database:
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without DB created"
runs-on: "ubuntu-20.04"
services:
rabbitmq:
image: rabbitmq:3-alpine
ports:
- 5672:5672
redis:
image: redis:6-alpine
ports:
- 6379:6379
strategy:
fail-fast: true
matrix:
php:
- "8.2"
database:
- "mysql"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
with:
fetch-depth: 2
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
coverage: none
tools: pecl
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
ini-values: "date.timezone=Europe/Paris"
- name: "Setup MySQL"
if: "${{ matrix.database == 'mysql' }}"
run: |
sudo systemctl start mysql.service
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
composer-options: "--optimize-autoloader --prefer-dist"
- name: "Install wallabag"
run: "php bin/console wallabag:install --env=test"
- name: "Prepare fixtures"
run: "make fixtures"
- name: "Run PHPUnit"
run: "php bin/simple-phpunit -v"

View File

@ -5,7 +5,7 @@ on:
push:
branches:
- master
- 2.*
- "2.**"
permissions:
contents: read
@ -13,7 +13,7 @@ permissions:
jobs:
translations:
name: "Translations"
runs-on: "ubuntu-20.04"
runs-on: ubuntu-latest
strategy:
matrix:
@ -22,7 +22,7 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"

View File

@ -16,7 +16,7 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"

1
.gitignore vendored
View File

@ -15,6 +15,7 @@
.php-cs-fixer.cache
.phpunit.result.cache
phpunit.xml
docker-compose.override.yml
# Parameters
/app/config/parameters.yml

2
.nvmrc
View File

@ -1 +1 @@
16
20

View File

@ -1,5 +1,170 @@
# Changelog
## [2.6.14](https://github.com/wallabag/wallabag/tree/2.6.14)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.13...2.6.14)
### Improvements
* Add annotations filter to entries API endpoint by @skn in https://github.com/wallabag/wallabag/pull/8346
### Fixes
* Fix reading time computation for short entries by @andreadecorte in https://github.com/wallabag/wallabag/pull/8332
* Fix `urls` parameter when sending many urls to be stored using the API by @j0k3r in https://github.com/wallabag/wallabag/pull/8488
* Fix docker base image by @yguedidi in https://github.com/wallabag/wallabag/pull/8440
### Technical stuff
* Change version in wallabag.yml by @nicosomb in https://github.com/wallabag/wallabag/pull/8251
* Fix deprecation by @j0k3r in https://github.com/wallabag/wallabag/pull/8267
* Update dependencies by @yguedidi in https://github.com/wallabag/wallabag/pull/8435
* Bump deps (mostly for siteconfig) by @j0k3r in https://github.com/wallabag/wallabag/pull/8489
## [2.6.13](https://github.com/wallabag/wallabag/tree/2.6.13)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.12...2.6.13)
### Improvements
* Add support of Pocket CSV import by @kdecherf and @nicosomb in https://github.com/wallabag/wallabag/pull/8240
* Backport Pocket and Shaarli HTML imports from master by @nicosomb in https://github.com/wallabag/wallabag/pull/8193
### Fixes
* Avoid non-validated OTP to be enabled #8139 by @j0k3r in https://github.com/wallabag/wallabag/pull/8139
### Technical stuff
* Update j0k3r/php-readability:1.2.13 to fix regression (about latin1 instead of UTF-8 used for entries) by @nicosomb https://github.com/wallabag/wallabag/pull/8194
## [2.6.12](https://github.com/wallabag/wallabag/tree/2.6.12)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.11...2.6.12)
### Technical stuff
* Fix changelog by @yguedidi in https://github.com/wallabag/wallabag/pull/8135
* Update dependencies by @yguedidi in https://github.com/wallabag/wallabag/pull/8136
## [2.6.11](https://github.com/wallabag/wallabag/tree/2.6.11)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.10...2.6.11)
### Security fix
* Protect actions with a CSRF token by @yguedidi in https://github.com/wallabag/wallabag/commit/99c8a06594d6ee7480ce4d041ccff3025b353656
### Fixes
* Fix redirection after action in search results by @nicosomb in https://github.com/wallabag/wallabag/pull/7827
* Fix title tag filter by @nicosomb in https://github.com/wallabag/wallabag/pull/7846
* Change NB_ELEMENTS in pocket importer to 30 by @j0k3r in https://github.com/wallabag/wallabag/pull/7993
* Fix entries counter for annotated entries in the menu by @j0k3r in https://github.com/wallabag/wallabag/pull/7999
### Technical stuff
* Prepare 2.6.11 release by @yguedidi in https://github.com/wallabag/wallabag/pull/8133
## [2.6.10](https://github.com/wallabag/wallabag/tree/2.6.10)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.9...2.6.10)
### Improvement
* Add Omnivore import by @nicosomb in https://github.com/wallabag/wallabag/pull/7754
### Fixes
* Update site config & tests by @j0k3r in https://github.com/wallabag/wallabag/pull/7582 (fixes "Key provided is shorter
than 256 bits, only 240 bits provided" https://github.com/wallabag/wallabag/issues/7531)
* Update site config by @yguedidi in https://github.com/wallabag/wallabag/pull/7623
* Replace gitter with matrix by @nicosomb in https://github.com/wallabag/wallabag/pull/7753
## [2.6.9](https://github.com/wallabag/wallabag/tree/2.6.9)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.8...2.6.9)
### Fixes
* Fix same domain pagination by @yguedidi in https://github.com/wallabag/wallabag/pull/7266
* Upgrade PHP dependencies by @yguedidi in https://github.com/wallabag/wallabag/pull/7272
* Use a proper "how to" for elCurator by @j0k3r in https://github.com/wallabag/wallabag/pull/7323
## [2.6.8](https://github.com/wallabag/wallabag/tree/2.6.8)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.7...2.6.8)
### Fixes
* Update deps & Node 20 by @j0k3r in https://github.com/wallabag/wallabag/pull/7134
* Fix dark mode disabled url 2.6 by @Simounet in https://github.com/wallabag/wallabag/pull/7133
* Make database dependent commands lazy by @yguedidi in https://github.com/wallabag/wallabag/pull/7142
* Fix docker setup by @yguedidi in https://github.com/wallabag/wallabag/pull/7141
* Remove session-based redirection by @yguedidi in https://github.com/wallabag/wallabag/pull/7140
## [2.6.7](https://github.com/wallabag/wallabag/tree/2.6.7)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.6...2.6.7)
### Security fix
* A user can disable her 2FA unintentionally by @kdecherf in https://github.com/wallabag/wallabag/commit/0cfdddc2eb0aee5ffb69bf499d377d75655ba157
### Fixes
* Fix deprecated null tag parameter by @Simounet in https://github.com/wallabag/wallabag/pull/6985
* Full clickable card on mass action by @Simounet in https://github.com/wallabag/wallabag/pull/6991
* Add tag form submit button always displayed by @Simounet in https://github.com/wallabag/wallabag/pull/6986
## [2.6.6](https://github.com/wallabag/wallabag/tree/2.6.6)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.5...2.6.6)
### Security fix
* Force secure cookie on HTTPS connection by @j0k3r in https://github.com/wallabag/wallabag/pull/6924
### Fixes
* Fix checkboxes pointer events issue by @Simounet in https://github.com/wallabag/wallabag/pull/6897
* Add Google mailer by @j0k3r in https://github.com/wallabag/wallabag/pull/6899
* Improve performance on homepage by @Simounet in https://github.com/wallabag/wallabag/pull/6909
* Mass action layout improved by @Simounet in https://github.com/wallabag/wallabag/pull/6912
## [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)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.3...2.6.4)
### Fixes
* Fix API token generation by @nicosomb https://github.com/wallabag/wallabag/pull/6869
* Fix checkboxes which were broken by @nicosomb https://github.com/wallabag/wallabag/pull/6864
## [2.6.3](https://github.com/wallabag/wallabag/tree/2.6.3)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.2...2.6.3)
### Security fixes
* Replace GET way to POST way to reset data user by @nicosomb https://github.com/wallabag/wallabag/commit/78b0b55c40511e1f22d5bbb4897aa10fca68441c
* Replace GET way to POST way to delete API client by @nicosomb https://github.com/wallabag/wallabag/commit/ffcc5c9062fcc8cd922d7d6d65edbe5efae96806
### Improvement
* Add confirmation before reload entry by @nicosomb https://github.com/wallabag/wallabag/pull/6778
* Remove external dependencies on howto page by @viktoriussuwandi https://github.com/wallabag/wallabag/pull/6775
### Fixes
* Use Session instead of Referrer for Redirection by @Spoons https://github.com/wallabag/wallabag/pull/6119
* Reduce risk of collision for #content by @kdecherf https://github.com/wallabag/wallabag/pull/6829
* Update dependencies to fix vulnerabilities by @nicosomb https://github.com/wallabag/wallabag/pull/6783
* Fix failing randomly test by @nicosomb https://github.com/wallabag/wallabag/pull/6763
### Technical stuff
* Add check if git is installed by @nicosomb https://github.com/wallabag/wallabag/pull/6788
* Replace kernel.root_dir by kernel.project_dir by @yguedidi https://github.com/wallabag/wallabag/pull/6809
* Split symfony/symfony by @yguedidi https://github.com/wallabag/wallabag/pull/6817
* Make Crawler::extract get an array by @yguedidi https://github.com/wallabag/wallabag/pull/6812
* Use PSR-17 and PSR-18 by @yguedidi https://github.com/wallabag/wallabag/pull/6816
* Replace Client by KernelBrowser by @yguedidi https://github.com/wallabag/wallabag/pull/6813
* Replace Debug component by ErrorHandler component by @yguedidi https://github.com/wallabag/wallabag/pull/6810
* Make ImportController extends AbstractController by @yguedidi https://github.com/wallabag/wallabag/pull/6808
* Use Twig instead of templating by @yguedidi https://github.com/wallabag/wallabag/pull/6797
* Identify platforms by their class by @yguedidi https://github.com/wallabag/wallabag/pull/6799
* Move from transchoice to trans by @yguedidi https://github.com/wallabag/wallabag/pull/6800
* Replace GetResponseEvent by RequestEvent by @yguedidi https://github.com/wallabag/wallabag/pull/6811
* Ensure the kernel is shut down before calling createClient by @yguedidi https://github.com/wallabag/wallabag/pull/6803
* Ignore docker-compose.override.yml by @yguedidi https://github.com/wallabag/wallabag/pull/6814
* Add composer normalizer by @nicosomb https://github.com/wallabag/wallabag/pull/6762
## [2.6.2](https://github.com/wallabag/wallabag/tree/2.6.2)
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.1...2.6.2)

View File

@ -1,7 +1,7 @@
# wallabag
![CI](https://github.com/wallabag/wallabag/workflows/CI/badge.svg)
[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/wallabag/wallabag)
[![Matrix](https://matrix.to/img/matrix-badge.svg)](https://matrix.to/#/#wallabag:matrix.org)
[![Donation Status](https://img.shields.io/liberapay/goal/wallabag.svg?logo=liberapay)](https://liberapay.com/wallabag/donate)
[![Translation status](https://hosted.weblate.org/widgets/wallabag/-/svg-badge.svg)](https://hosted.weblate.org/engage/wallabag/?utm_source=widget)
![License](https://img.shields.io/github/license/wallabag/wallabag)

View File

@ -62,11 +62,6 @@ class AppKernel extends Kernel
return $bundles;
}
public function getRootDir()
{
return __DIR__;
}
public function getCacheDir()
{
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
@ -79,7 +74,7 @@ class AppKernel extends Kernel
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
$loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml');
$loader->load(function ($container) {
if ($container->getParameter('use_webpack_dev_server')) {

View File

@ -2,6 +2,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -14,8 +17,10 @@ class Version20160401000000 extends WallabagMigration
{
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$sql = <<<SQL
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
@ -58,7 +63,7 @@ SQL
}
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$sql = <<<SQL
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
@ -91,7 +96,7 @@ SQL
$this->addSql($query);
}
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$sql = <<<SQL
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -15,7 +16,7 @@ class Version20160812120952 extends WallabagMigration
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
// Can't use $clientsTable->addColumn('name', 'blob');
// because of the error:
// SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
@ -35,7 +36,7 @@ class Version20160812120952 extends WallabagMigration
{
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
$databaseTablePrefix = $this->container->getParameter('database_table_prefix');
$this->addSql('DROP INDEX IDX_635D765EA76ED395');
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');

View File

@ -3,6 +3,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\SkipMigrationException;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -13,11 +16,13 @@ class Version20161001072726 extends WallabagMigration
{
public function up(Schema $schema): void
{
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
$platform = $this->connection->getDatabasePlatform();
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
// remove all FK from entry_tag
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'mysql':
switch (true) {
case $platform instanceof MySQLPlatform:
$query = $this->connection->query("
SELECT CONSTRAINT_NAME
FROM information_schema.key_column_usage
@ -29,7 +34,7 @@ class Version20161001072726 extends WallabagMigration
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
}
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
$query = $this->connection->query("
SELECT conrelid::regclass AS table_from
@ -53,8 +58,8 @@ class Version20161001072726 extends WallabagMigration
// remove entry FK from annotation
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'mysql':
switch (true) {
case $platform instanceof MySQLPlatform:
$query = $this->connection->query("
SELECT CONSTRAINT_NAME
FROM information_schema.key_column_usage
@ -68,7 +73,7 @@ class Version20161001072726 extends WallabagMigration
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
}
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
$query = $this->connection->query("
SELECT conrelid::regclass AS table_from

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -12,7 +13,7 @@ class Version20161022134138 extends WallabagMigration
{
public function up(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
@ -40,7 +41,7 @@ class Version20161022134138 extends WallabagMigration
public function down(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -37,7 +38,7 @@ class Version20161024212538 extends WallabagMigration
$clientsTable->dropColumn('user_id', 'integer');
if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) {
if (!$this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
$clientsTable->removeForeignKey($this->constraintName);
}
}

View File

@ -2,6 +2,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -16,18 +19,20 @@ class Version20161214094402 extends WallabagMigration
$this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.');
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM ' . $this->getTable('entry'));
$this->addSql('DROP TABLE ' . $this->getTable('entry'));
$this->addSql('CREATE TABLE ' . $this->getTable('entry') . ' (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT "0", PRIMARY KEY(id));');
$this->addSql('INSERT INTO ' . $this->getTable('entry') . ' (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public) SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM __temp__wallabag_entry;');
$this->addSql('DROP TABLE __temp__wallabag_entry');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uuid uid VARCHAR(23)');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uuid TO uid');
}
}
@ -38,14 +43,16 @@ class Version20161214094402 extends WallabagMigration
$this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.');
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
throw new SkipMigrationException('Too complex ...');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uid uuid VARCHAR(23)');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
}
}

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -25,7 +26,7 @@ class Version20170501115751 extends WallabagMigration
$table->setPrimaryKey(['id']);
$table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$schema->dropSequence('site_credential_id_seq');
$schema->createSequence('site_credential_id_seq');
}

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -19,7 +20,7 @@ class Version20170510082609 extends WallabagMigration
public function up(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
foreach ($this->fields as $field) {
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;');
@ -28,7 +29,7 @@ class Version20170510082609 extends WallabagMigration
public function down(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
foreach ($this->fields as $field) {
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');

View File

@ -3,6 +3,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\SkipMigrationException;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -13,8 +16,10 @@ class Version20170511211659 extends WallabagMigration
{
public function up(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$annotationTableName = $this->getTable('annotation', true);
$userTableName = $this->getTable('user', true);
$entryTableName = $this->getTable('entry', true);
@ -22,12 +27,12 @@ class Version20170511211659 extends WallabagMigration
$this->addSql(<<<EOD
CREATE TEMPORARY TABLE __temp__wallabag_annotation AS
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
FROM ${annotationTableName}
FROM {$annotationTableName}
EOD
);
$this->addSql('DROP TABLE ' . $annotationTableName);
$this->addSql(<<<EOD
CREATE TABLE ${annotationTableName}
CREATE TABLE {$annotationTableName}
(
id INTEGER PRIMARY KEY NOT NULL,
user_id INTEGER DEFAULT NULL,
@ -37,26 +42,26 @@ CREATE TABLE ${annotationTableName}
updated_at DATETIME NOT NULL,
quote CLOB NOT NULL,
ranges CLOB NOT NULL,
CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES ${userTableName} (id),
CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES ${entryTableName} (id) ON DELETE CASCADE
CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES {$userTableName} (id),
CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES {$entryTableName} (id) ON DELETE CASCADE
);
CREATE INDEX IDX_A7AED006A76ED395 ON ${annotationTableName} (user_id);
CREATE INDEX IDX_A7AED006BA364942 ON ${annotationTableName} (entry_id);
CREATE INDEX IDX_A7AED006A76ED395 ON {$annotationTableName} (user_id);
CREATE INDEX IDX_A7AED006BA364942 ON {$annotationTableName} (entry_id);
EOD
);
$this->addSql(<<<EOD
INSERT INTO ${annotationTableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges)
INSERT INTO {$annotationTableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges)
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
FROM __temp__wallabag_annotation;
EOD
);
$this->addSql('DROP TABLE __temp__wallabag_annotation');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT');
break;
}
@ -66,14 +71,16 @@ EOD
{
$tableName = $this->getTable('annotation');
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
throw new SkipMigrationException('Too complex ...');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote VARCHAR(255) NOT NULL');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE VARCHAR(255)');
break;
}

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -12,7 +13,7 @@ class Version20170719231144 extends WallabagMigration
{
public function up(Schema $schema): void
{
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
$this->skipIf($this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
// Find tags which need to be merged
$dupTags = $this->connection->query('

View File

@ -2,6 +2,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -12,14 +15,16 @@ class Version20171008195606 extends WallabagMigration
{
public function up(Schema $schema): void
{
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
$platform = $this->connection->getDatabasePlatform();
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'mysql':
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
switch (true) {
case $platform instanceof MySQLPlatform:
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time SET NOT NULL;');
break;
@ -28,13 +33,15 @@ class Version20171008195606 extends WallabagMigration
public function down(Schema $schema): void
{
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
$platform = $this->connection->getDatabasePlatform();
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'mysql':
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
switch (true) {
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11);');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time DROP NOT NULL;');
break;
}

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -12,7 +13,7 @@ class Version20181128203230 extends WallabagMigration
{
public function up(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(191)');
@ -27,7 +28,7 @@ class Version20181128203230 extends WallabagMigration
public function down(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(255)');

View File

@ -2,6 +2,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -12,8 +15,10 @@ final class Version20181202073750 extends WallabagMigration
{
public function up(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
@ -28,13 +33,13 @@ final class Version20181202073750 extends WallabagMigration
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $this->getTable('user', true) . ' (email_canonical)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $this->getTable('user', true) . ' (username_canonical)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN twofactorauthentication TO emailTwoFactor');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
@ -45,8 +50,10 @@ final class Version20181202073750 extends WallabagMigration
public function down(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
@ -59,13 +66,13 @@ final class Version20181202073750 extends WallabagMigration
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "' . $this->getTable('user', true) . '" (email_canonical)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "' . $this->getTable('user', true) . '" (confirmation_token)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret');
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL');
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` ADD trusted TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP backupCodes');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP googleAuthenticatorSecret');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN emailTwoFactor TO twofactorauthentication');
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD trusted TEXT DEFAULT NULL');

View File

@ -2,6 +2,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -12,8 +15,10 @@ final class Version20190425115043 extends WallabagMigration
{
public function up(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM ' . $this->getTable('config', true));
$this->addSql('DROP TABLE ' . $this->getTable('config', true));
@ -22,11 +27,11 @@ final class Version20190425115043 extends WallabagMigration
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON ' . $this->getTable('config', true) . ' (user_id)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_token feed_token VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_limit feed_limit INT DEFAULT NULL');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_token TO feed_token');
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_limit TO feed_limit');
break;
@ -35,8 +40,10 @@ final class Version20190425115043 extends WallabagMigration
public function down(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM "' . $this->getTable('config', true) . '"');
$this->addSql('DROP TABLE "' . $this->getTable('config', true) . '"');
@ -45,11 +52,11 @@ final class Version20190425115043 extends WallabagMigration
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "' . $this->getTable('config', true) . '" (user_id)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_token rss_token');
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_limit rss_limit');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_token TO rss_token');
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_limit TO rss_limit');
break;

View File

@ -3,6 +3,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\SkipMigrationException;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -17,8 +20,10 @@ final class Version20190510141130 extends WallabagMigration
{
public function up(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('DROP INDEX IDX_368A4209A76ED395');
$this->addSql('DROP INDEX IDX_368A420919EB6921');
$this->addSql('DROP INDEX UNIQ_368A42095F37A13B');
@ -60,7 +65,7 @@ final class Version20190510141130 extends WallabagMigration
$this->addSql('CREATE INDEX IDX_EE52E3FAA76ED395 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (user_id)');
$this->addSql('CREATE INDEX IDX_EE52E3FA19EB6921 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (client_id)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP FOREIGN KEY FK_368A4209A76ED395');
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
@ -75,7 +80,7 @@ final class Version20190510141130 extends WallabagMigration
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' DROP FOREIGN KEY FK_EE52E3FAA76ED395');
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP CONSTRAINT FK_368A4209A76ED395');
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -14,7 +15,7 @@ final class Version20190511165128 extends WallabagMigration
{
public function up(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
@ -22,7 +23,7 @@ final class Version20190511165128 extends WallabagMigration
public function down(Schema $schema): void
{
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');

View File

@ -2,6 +2,7 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -14,7 +15,7 @@ final class Version20190619093534 extends WallabagMigration
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
$this->addSql('UPDATE ' . $this->getTable('entry', true) . ' SET reading_time = 0 WHERE reading_time IS NULL;');
@ -42,7 +43,7 @@ final class Version20190619093534 extends WallabagMigration
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
$this->addSql('DROP INDEX created_at');

View File

@ -2,6 +2,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -18,8 +21,10 @@ final class Version20190806130304 extends WallabagMigration
{
public function up(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('DROP INDEX uid');
$this->addSql('DROP INDEX created_at');
$this->addSql('DROP INDEX hashed_url_user_id');
@ -44,7 +49,7 @@ final class Version20190806130304 extends WallabagMigration
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag', true) . ' (label)');
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config', true) . ' (feed_token)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
@ -53,7 +58,7 @@ final class Version20190806130304 extends WallabagMigration
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag') . ' (label (255))');
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config') . ' (feed_token (255))');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
@ -67,8 +72,10 @@ final class Version20190806130304 extends WallabagMigration
public function down(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
$this->addSql('DROP INDEX created_at');
$this->addSql('DROP INDEX uid');
@ -93,7 +100,7 @@ final class Version20190806130304 extends WallabagMigration
$this->addSql('CREATE INDEX hashed_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_url)');
$this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
@ -102,7 +109,7 @@ final class Version20190806130304 extends WallabagMigration
$this->addSql('DROP INDEX tag_label ON ' . $this->getTable('tag'));
$this->addSql('DROP INDEX config_feed_token ON ' . $this->getTable('config'));
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));

View File

@ -2,6 +2,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -12,14 +15,16 @@ final class Version20190808124957 extends WallabagMigration
{
public function up(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true));
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting'));
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting'));
break;
}
@ -27,14 +32,16 @@ final class Version20190808124957 extends WallabagMigration
public function down(Schema $schema): void
{
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true));
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting'));
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting'));
break;
}

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -23,7 +24,7 @@ final class Version20190826204730 extends WallabagMigration
$userTable->setPrimaryKey(['id']);
$userTable->addForeignKeyConstraint($this->getTable('config'), ['config_id'], ['id'], [], 'fk_config');
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$schema->dropSequence('ignore_origin_user_rule_id_seq');
$schema->createSequence('ignore_origin_user_rule_id_seq');
}
@ -35,7 +36,7 @@ final class Version20190826204730 extends WallabagMigration
$instanceTable->addColumn('rule', 'string', ['length' => 255]);
$instanceTable->setPrimaryKey(['id']);
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$schema->dropSequence('ignore_origin_instance_rule_id_seq');
$schema->createSequence('ignore_origin_instance_rule_id_seq');
}

View File

@ -2,6 +2,9 @@
namespace Application\Migrations;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema;
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
@ -13,8 +16,10 @@ final class Version20221221092957 extends WallabagMigration
public function up(Schema $schema): void
{
$userTable = $this->getTable('user');
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM ' . $userTable);
$this->addSql('DROP TABLE ' . $userTable);
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
@ -26,10 +31,10 @@ final class Version20221221092957 extends WallabagMigration
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupcodes TYPE JSON USING backupcodes::json');
break;
}
@ -38,8 +43,10 @@ final class Version20221221092957 extends WallabagMigration
public function down(Schema $schema): void
{
$userTable = $this->getTable('user');
switch ($this->connection->getDatabasePlatform()->getName()) {
case 'sqlite':
$platform = $this->connection->getDatabasePlatform();
switch (true) {
case $platform instanceof SqlitePlatform:
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM ' . $userTable);
$this->addSql('DROP TABLE ' . $userTable);
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
@ -51,10 +58,10 @@ final class Version20221221092957 extends WallabagMigration
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
break;
case 'mysql':
case $platform instanceof MySQLPlatform:
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
break;
case 'postgresql':
case $platform instanceof PostgreSQLPlatform:
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupCodes TYPE TEXT');
break;
}

View File

@ -235,6 +235,12 @@
z-index: 9999;
}
.tags-add-form {
display: flex;
align-items: center;
gap: 20px;
}
@media only screen and (max-width: 640px) {
.entry-info {
margin-bottom: 20px;
@ -258,4 +264,12 @@
#article .entry-info .chip-action {
min-width: 40px;
}
.tags-add-form {
display: block;
}
.tags-add-form-submit {
margin-top: 10px;
}
}

View File

@ -3,7 +3,7 @@
========================================================================== */
main {
#content {
div#content {
padding: 0 0.5rem;
}
}
@ -177,6 +177,7 @@ a.original:not(.waves-effect) {
.card-entry-tags a,
.card-entry-labels a,
.card-tag-labels a,
.card-tag-labels button,
.card-entry-labels-hidden a,
#list .chip a {
text-decoration: none;

View File

@ -62,7 +62,9 @@
.nav-panels .input-field input:focus,
.results-item,
.side-nav li > a,
.side-nav li > a > i.material-icons {
.side-nav li > a > i.material-icons,
.side-nav li button,
.side-nav li button > i.material-icons {
color: #dfdfdf;
}
@ -85,7 +87,9 @@
background-color: #2f2f2f;
}
.mass-action-tags .mass-action-tags-input.mass-action-tags-input,
.side-nav li:not(.logo) > a:hover,
.side-nav li:not(.logo) button:hover,
.side-nav .collapsible-header:hover,
.side-nav.fixed .collapsible-header:hover {
background-color: #1d1d1d;
@ -131,6 +135,10 @@
color: #abb2bf;
}
input[type="url"]:not(.browser-default):disabled {
color: #9e9e9e;
}
.input-field.nav-panel-add.disabled,
.input-field.nav-panel-add.disabled input {
background-color: transparent;

View File

@ -14,44 +14,53 @@
}
.mass-action {
margin: 10px 5px 10px 20px;
margin: 20px 5px 10px 20px;
}
.mass-action-group {
display: flex;
padding: 3px;
gap: 10px;
align-items: center;
gap: 30px;
}
.mass-action-button {
height: 24px;
line-height: 24px;
padding: 0 0.5rem;
height: 36px;
line-height: 36px;
padding: 0 0.7rem;
i {
font-size: 1rem;
}
}
.entry-checkbox {
margin: 10px 15px 10px 5px;
.mass-action-button--tags {
border-radius: 2px 0 0 2px;
}
.card & {
float: right;
margin-right: 0;
padding: 10px;
}
.card-stacked .entry-checkbox {
margin: 10px 15px 10px 5px;
}
.card .entry-checkbox {
position: absolute;
display: flex;
padding: 10px;
inset: 0;
justify-content: flex-end;
align-items: start;
background-color: rgb(0 172 193 / 20%);
cursor: pointer;
z-index: 10;
}
.entries .entry-checkbox-input,
.mass-action .entry-checkbox-input {
position: relative;
left: 0;
width: 20px;
min-height: 25px;
height: 100%;
vertical-align: middle;
opacity: initial;
cursor: pointer;
z-index: 10;
}
@ -64,11 +73,19 @@
.mass-action-tags {
display: flex;
align-items: center;
gap: 10px;
margin-top: 10px;
.mass-action-tags-input {
.mass-action-tags-input.mass-action-tags-input {
margin: 0;
padding: 0 5px;
height: 34px;
background: white;
border-bottom: 3px solid #c5ebef;
}
.mass-action-tags-input.mass-action-tags-input.mass-action-tags-input:focus {
border-bottom: 3px solid $blue-accent-color;
box-shadow: none;
}
}
@ -88,13 +105,16 @@
.results {
display: flex;
margin-bottom: 10px;
padding: 1rem 1rem 0;
flex-wrap: wrap;
justify-content: space-between;
}
.nb-results {
display: inline-flex;
}
.nb-results {
display: inline-flex;
margin-bottom: 20px;
gap: 30px;
}
.results-item {
@ -173,9 +193,38 @@ footer {
}
@media screen and (min-width: 993px) {
.results {
margin-bottom: 0;
}
.nb-results {
margin-bottom: 0;
gap: 0;
}
.mass-action-button {
height: 24px;
line-height: 24px;
padding: 0 0.5rem;
}
.mass-action-group {
gap: 10px;
}
.mass-action-tags {
margin-top: 0;
margin-left: 7px;
flex-wrap: initial;
}
.mass-action {
display: flex;
margin-top: 10px;
align-items: center;
gap: 30px;
.mass-action-tags-input.mass-action-tags-input {
height: 21px;
}
}
}

View File

@ -21,7 +21,7 @@
}
@media screen and (min-width: 993px) {
.entry #content {
.entry main div#content {
padding-left: 70px;
}
}

View File

@ -6,11 +6,32 @@ nav {
line-height: initial;
}
// adapted from anchor styles from node_modules/materialize-css/sass/components/_navbar.scss
nav ul button {
transition: background-color .3s;
font-size: 1rem;
color: #fff;
display: block;
padding: 0 15px;
cursor: pointer;
background: none;
border: 0;
&:focus {
background: none;
}
&:hover {
background-color: rgba(0 0 0 / 10%);
}
}
nav {
input {
color: #aaa;
}
ul button:hover,
ul a:hover {
background-color: initial;
}
@ -34,6 +55,7 @@ nav {
justify-content: space-between;
align-items: center;
button,
a {
padding: 10px 15px;
}
@ -70,6 +92,7 @@ nav {
.input-field input {
display: block;
font-size: 1.2rem;
line-height: inherit;
height: 3rem;
}
@ -79,6 +102,17 @@ nav {
box-shadow: none;
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 {

View File

@ -12,6 +12,7 @@
background: initial;
}
& button > i.material-icons.theme-toggle-icon,
& > a > i.material-icons.theme-toggle-icon {
float: none;
margin-left: 0;
@ -22,6 +23,7 @@
margin: 0;
}
&.fixed button,
&.fixed a {
font-size: 13px;
line-height: 44px;
@ -41,7 +43,35 @@
}
}
.bold > a {
// adapted from anchor styles from node_modules/materialize-css/sass/components/_sideNav.scss
.side-nav li button {
color: rgba(0 0 0 / 87%);
display: block;
font-size: 14px;
font-weight: 500;
height: 48px;
line-height: 48px;
padding: 0 (16px * 2);
width: 100%;
text-align: left;
&:hover {
background-color: rgba(0 0 0 / 5%);
}
& > i,
& > i.material-icons {
float: left;
height: 48px;
line-height: 48px;
margin: 0 (16px * 2) 0 0;
width: 24px;
color: rgba(0 0 0 / 54%);
}
}
.bold > a,
.bold > button {
font-weight: bold;
}

View File

@ -15,6 +15,13 @@ div.settings div.file-field {
}
}
/* override materializecss pointer-event disabled on checkboxes */
[type="checkbox"]:not(:checked),
[type="checkbox"]:checked,
.input-field label {
pointer-events: initial;
}
.input-field label.active {
font-size: 1rem;
}
@ -31,3 +38,18 @@ nav .input-field input {
.tab {
flex: 1;
}
.btn-link {
background: none;
border: 0;
padding: 0;
color: $blue-accent-color;
&:focus {
background: none;
}
}
.inline-block {
display: inline-block;
}

View File

@ -228,10 +228,10 @@ $(document).ready(() => {
});
});
}
$('form[name="form_mass_action"] input[name="tags"]').on('keydown', (e) => {
$('input[name="tags"][form="form_mass_action"]').on('keydown', (e) => {
if (e.key === 'Enter') {
e.preventDefault();
$('form[name="form_mass_action"] button[name="tag"]').trigger('click');
$('button[name="tag"][form="form_mass_action"]').trigger('click');
}
});
});

View File

@ -10,17 +10,17 @@ $(document).ready(() => {
/* mark as favorite */
Mousetrap.bind('f', () => {
$('ul.side-nav a.favorite i')[0].click();
$('ul.side-nav button.favorite i')[0].click();
});
/* mark as read */
Mousetrap.bind('a', () => {
$('ul.side-nav a.markasread i')[0].click();
$('ul.side-nav button.markasread i')[0].click();
});
/* delete */
Mousetrap.bind('del', () => {
$('ul.side-nav a.delete i')[0].click();
$('ul.side-nav button.delete i')[0].click();
});
}
});

View File

@ -23,14 +23,14 @@ framework:
csrf_protection: ~
validation:
enable_annotations: true
templating:
engines: ['twig']
default_locale: "%locale%"
trusted_hosts: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: session.handler.native_file
save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
cookie_secure: auto
cookie_samesite: lax
fragments: ~
http_method_override: true
assets: ~
@ -43,7 +43,6 @@ twig:
strict_variables: "%kernel.debug%"
form_themes:
- "@LexikFormFilter/Form/form_div_layout.html.twig"
exception_controller: Wallabag\CoreBundle\Controller\ExceptionController:showAction
globals:
registration_enabled: '%fosuser_registration%'
@ -269,6 +268,11 @@ old_sound_rabbit_mq:
exchange_options:
name: 'wallabag.import.elcurator'
type: topic
import_omnivore:
connection: default
exchange_options:
name: 'wallabag.import.omnivore'
type: topic
import_firefox:
connection: default
exchange_options:
@ -279,6 +283,21 @@ old_sound_rabbit_mq:
exchange_options:
name: 'wallabag.import.chrome'
type: topic
import_shaarli:
connection: default
exchange_options:
name: 'wallabag.import.shaarli'
type: topic
import_pocket_html:
connection: default
exchange_options:
name: 'wallabag.import.pocket_html'
type: topic
import_pocket_csv:
connection: default
exchange_options:
name: 'wallabag.import.pocket_csv'
type: topic
consumers:
import_pocket:
connection: default
@ -352,6 +371,15 @@ old_sound_rabbit_mq:
name: 'wallabag.import.elcurator'
callback: wallabag_import.consumer.amqp.elcurator
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
import_omnivore:
connection: default
exchange_options:
name: 'wallabag.import.omnivore'
type: topic
queue_options:
name: 'wallabag.import.omnivore'
callback: wallabag_import.consumer.amqp.omnivore
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
import_firefox:
connection: default
exchange_options:
@ -370,6 +398,33 @@ old_sound_rabbit_mq:
name: 'wallabag.import.chrome'
callback: wallabag_import.consumer.amqp.chrome
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
import_shaarli:
connection: default
exchange_options:
name: 'wallabag.import.shaarli'
type: topic
queue_options:
name: 'wallabag.import.shaarli'
callback: wallabag_import.consumer.amqp.shaarli
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
import_pocket_html:
connection: default
exchange_options:
name: 'wallabag.import.pocket_html'
type: topic
queue_options:
name: 'wallabag.import.pocket_html'
callback: wallabag_import.consumer.amqp.pocket_html
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
import_pocket_csv:
connection: default
exchange_options:
name: 'wallabag.import.pocket_csv'
type: topic
queue_options:
name: 'wallabag.import.pocket_csv'
callback: wallabag_import.consumer.amqp.pocket_csv
qos_options: {prefetch_count: "%rabbitmq_prefetch_count%"}
fos_js_routing:
routes_to_expose:

View File

@ -12,7 +12,7 @@ services:
autoconfigure: true
public: true
bind:
$rootDir: '%kernel.root_dir%'
$projectDir: '%kernel.project_dir%'
$debug: '%kernel.debug%'
$defaultLocale: '%kernel.default_locale%'
$wallabagUrl: '%domain_name%'
@ -81,6 +81,11 @@ services:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_elcurator_producer'
$redisProducer: '@wallabag_import.producer.redis.elcurator'
Wallabag\ImportBundle\Controller\OmnivoreController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_omnivore_producer'
$redisProducer: '@wallabag_import.producer.redis.omnivore'
Wallabag\ImportBundle\Controller\FirefoxController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_firefox_producer'
@ -116,6 +121,21 @@ services:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v2_producer'
$redisProducer: '@wallabag_import.producer.redis.wallabag_v2'
Wallabag\ImportBundle\Controller\ShaarliController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_shaarli_producer'
$redisProducer: '@wallabag_import.producer.redis.shaarli'
Wallabag\ImportBundle\Controller\PocketHtmlController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_pocket_html_producer'
$redisProducer: '@wallabag_import.producer.redis.pocket_html'
Wallabag\ImportBundle\Controller\PocketCsvController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_pocket_csv_producer'
$redisProducer: '@wallabag_import.producer.redis.pocket_csv'
Wallabag\ImportBundle\:
resource: '../../src/Wallabag/ImportBundle/*'
exclude: '../../src/Wallabag/ImportBundle/{Consumer,Controller,Redis}'
@ -268,9 +288,23 @@ services:
arguments:
$baseFolder: "%kernel.project_dir%/web/assets/images"
Wallabag\CoreBundle\Command\CleanDownloadedImagesCommand:
tags:
- { name: console.command, command: 'wallabag:clean-downloaded-images' }
Wallabag\CoreBundle\Command\CleanDuplicatesCommand:
tags:
- { name: console.command, command: 'wallabag:clean-duplicates' }
Wallabag\CoreBundle\Command\ExportCommand:
arguments:
$projectDir: '%kernel.project_dir%'
tags:
- { name: console.command, command: 'wallabag:export' }
Wallabag\CoreBundle\Command\GenerateUrlHashesCommand:
tags:
- { name: console.command, command: 'wallabag:generate-hashed-urls' }
Wallabag\CoreBundle\Command\InstallCommand:
arguments:
@ -279,6 +313,26 @@ services:
$defaultSettings: '%wallabag_core.default_internal_settings%'
$defaultIgnoreOriginInstanceRules: '%wallabag_core.default_ignore_origin_instance_rules%'
Wallabag\CoreBundle\Command\ListUserCommand:
tags:
- { name: console.command, command: 'wallabag:user:list' }
Wallabag\CoreBundle\Command\ReloadEntryCommand:
tags:
- { name: console.command, command: 'wallabag:entry:reload' }
Wallabag\CoreBundle\Command\ShowUserCommand:
tags:
- { name: console.command, command: 'wallabag:user:show' }
Wallabag\CoreBundle\Command\TagAllCommand:
tags:
- { name: console.command, command: 'wallabag:tag:all' }
Wallabag\ImportBundle\Command\ImportCommand:
tags:
- { name: console.command, command: 'wallabag:import' }
wallabag_core.entry.download_images.client:
alias: 'httplug.client.wallabag_core.entry.download_images'
@ -343,6 +397,10 @@ services:
tags:
- { name: wallabag_import.import, alias: delicious }
Wallabag\ImportBundle\Import\OmnivoreImport:
tags:
- { name: wallabag_import.import, alias: omnivore }
Wallabag\ImportBundle\Import\FirefoxImport:
tags:
- { name: wallabag_import.import, alias: firefox }
@ -351,6 +409,18 @@ services:
tags:
- { name: wallabag_import.import, alias: chrome }
Wallabag\ImportBundle\Import\ShaarliImport:
tags:
- { name: wallabag_import.import, alias: shaarli }
Wallabag\ImportBundle\Import\PocketHtmlImport:
tags:
- { name: wallabag_import.import, alias: pocket_html }
Wallabag\ImportBundle\Import\PocketCsvImport:
tags:
- { name: wallabag_import.import, alias: pocket_csv }
# to factorize the proximity and bypass translation for prev & next
pagerfanta.view.default_wallabag:
class: Pagerfanta\View\OptionableView

View File

@ -18,6 +18,10 @@ services:
$pinboardConsumer: '@old_sound_rabbit_mq.import_pinboard_consumer'
$deliciousConsumer: '@old_sound_rabbit_mq.import_delicious_consumer'
$elcuratorConsumer: '@old_sound_rabbit_mq.import_elcurator_consumer'
$omnivoreConsumer: '@old_sound_rabbit_mq.import_omnivore_consumer'
$shaarliConsumer: '@old_sound_rabbit_mq.import_shaarli_consumer'
$pocketHtmlConsumer: '@old_sound_rabbit_mq.import_pocket_html_consumer'
$pocketCsvConsumer: '@old_sound_rabbit_mq.import_pocket_csv_consumer'
wallabag_import.consumer.amqp.pocket:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
@ -44,6 +48,11 @@ services:
arguments:
$import: '@Wallabag\ImportBundle\Import\DeliciousImport'
wallabag_import.consumer.amqp.omnivore:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\OmnivoreImport'
wallabag_import.consumer.amqp.wallabag_v1:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
arguments:
@ -68,3 +77,18 @@ services:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
wallabag_import.consumer.amqp.shaarli:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\ShaarliImport'
wallabag_import.consumer.amqp.pocket_html:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\PocketHtmlImport'
wallabag_import.consumer.amqp.pocket_csv:
class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\PocketCsvImport'

View File

@ -69,6 +69,22 @@ services:
arguments:
$import: '@Wallabag\ImportBundle\Import\DeliciousImport'
# Omnivore
wallabag_import.queue.redis.omnivore:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.omnivore"
wallabag_import.producer.redis.omnivore:
class: Wallabag\ImportBundle\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.omnivore"
wallabag_import.consumer.redis.omnivore:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\OmnivoreImport'
# pocket
wallabag_import.queue.redis.pocket:
class: Simpleue\Queue\RedisQueue
@ -164,3 +180,51 @@ services:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\ChromeImport'
# shaarli
wallabag_import.queue.redis.shaarli:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.shaarli"
wallabag_import.producer.redis.shaarli:
class: Wallabag\ImportBundle\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.shaarli"
wallabag_import.consumer.redis.shaarli:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\ShaarliImport'
# pocket html
wallabag_import.queue.redis.pocket_html:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.pocket_html"
wallabag_import.producer.redis.pocket_html:
class: Wallabag\ImportBundle\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.pocket_html"
wallabag_import.consumer.redis.pocket_html:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\PocketHtmlImport'
# pocket csv
wallabag_import.queue.redis.pocket_csv:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.pocket_csv"
wallabag_import.producer.redis.pocket_csv:
class: Wallabag\ImportBundle\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.pocket_csv"
wallabag_import.consumer.redis.pocket_csv:
class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer
arguments:
$import: '@Wallabag\ImportBundle\Import\PocketCsvImport'

View File

@ -1,5 +1,5 @@
wallabag_core:
version: 2.6.2
version: 2.6.14
paypal_url: "https://liberapay.com/wallabag/donate"
languages:
en: 'English'
@ -167,5 +167,11 @@ wallabag_core:
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
wallabag_import:
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv']
allow_mimetypes:
- 'application/octet-stream'
- 'application/json'
- 'text/plain'
- 'text/csv'
- 'text/html'
- 'application/vnd.ms-excel'
resource_dir: "%kernel.project_dir%/web/uploads/import"

View File

@ -2,16 +2,16 @@ const path = require('path');
const webpack = require('webpack');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const rootDir = path.resolve(__dirname, '../../../');
const projectDir = path.resolve(__dirname, '../../../');
module.exports = {
entry: {
material: path.join(rootDir, './app/Resources/static/themes/material/index.js'),
public: path.join(rootDir, './app/Resources/static/themes/_global/share.js'),
material: path.join(projectDir, './app/Resources/static/themes/material/index.js'),
public: path.join(projectDir, './app/Resources/static/themes/_global/share.js'),
},
output: {
filename: '[name].js',
path: path.resolve(rootDir, 'web/wallassets'),
path: path.resolve(projectDir, 'web/wallassets'),
publicPath: '',
},
plugins: [
@ -31,7 +31,7 @@ module.exports = {
],
resolve: {
alias: {
jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js'),
jquery: path.join(projectDir, 'node_modules/jquery/dist/jquery.js'),
},
},
};

View File

@ -3,7 +3,7 @@
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Symfony\Component\ErrorHandler\Debug;
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup

View File

@ -56,97 +56,125 @@
"ext-tidy": "*",
"ext-tokenizer": "*",
"ext-xml": "*",
"babdev/pagerfanta-bundle": "^3.7",
"bdunogier/guzzle-site-authenticator": "^1.0.0",
"craue/config-bundle": "^2.3.0",
"defuse/php-encryption": "^2.1",
"doctrine/collections": "^1.6",
"doctrine/common": "^3.0",
"doctrine/dbal": "^3.3",
"doctrine/doctrine-bundle": "^2.0",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/event-manager": "^1.1",
"doctrine/migrations": "^3.2",
"doctrine/orm": "^2.6",
"doctrine/persistence": "^3.0",
"egulias/email-validator": "^3.2",
"babdev/pagerfanta-bundle": "^3.8",
"bdunogier/guzzle-site-authenticator": "^1.1.0",
"craue/config-bundle": "^2.7.0",
"defuse/php-encryption": "^2.4",
"doctrine/collections": "^1.8",
"doctrine/common": "^3.4.3",
"doctrine/dbal": "^3.8.2",
"doctrine/doctrine-bundle": "^2.7.2",
"doctrine/doctrine-migrations-bundle": "^3.2.5",
"doctrine/event-manager": "^1.2",
"doctrine/migrations": "^3.5.5",
"doctrine/orm": "^2.18",
"doctrine/persistence": "^3.2",
"egulias/email-validator": "^3.2.6",
"enshrined/svg-sanitize": "^0.15.4",
"friendsofsymfony/jsrouting-bundle": "^2.2",
"friendsofsymfony/jsrouting-bundle": "^2.8",
"friendsofsymfony/oauth-server-bundle": "dev-master#dc8ff343363cf794d30eb1a123610d186a43f162",
"friendsofsymfony/rest-bundle": "~3.4",
"friendsofsymfony/user-bundle": "^3.1",
"guzzlehttp/guzzle": "^5.3.1",
"guzzlehttp/psr7": "^2.5",
"html2text/html2text": "^4.1",
"incenteev/composer-parameter-handler": "^2.1",
"j0k3r/graby": "^2.0",
"javibravo/simpleue": "^2.0",
"jms/serializer": "^3.17",
"jms/serializer-bundle": "~5.0",
"kphoen/rulerz": "^0.21",
"kphoen/rulerz-bundle": "~0.13",
"laminas/laminas-code": "^4.7",
"laminas/laminas-diactoros": "^2.3",
"lcobucci/jwt": "~4.1.5",
"lexik/form-filter-bundle": "^7.0",
"mgargano/simplehtmldom": "~1.5",
"friendsofsymfony/rest-bundle": "^3.5",
"friendsofsymfony/user-bundle": "^3.2.1",
"guzzlehttp/guzzle": "^5.3.4",
"guzzlehttp/psr7": "^2.6.2",
"html2text/html2text": "^4.3.1",
"incenteev/composer-parameter-handler": "^2.1.5",
"j0k3r/graby": "^2.4.5",
"j0k3r/php-readability": "^1.2.13",
"javibravo/simpleue": "^2.1",
"jms/serializer": "^3.29.1",
"jms/serializer-bundle": "^5.3.1",
"kphoen/rulerz": "^0.21.1",
"kphoen/rulerz-bundle": "^0.15",
"laminas/laminas-code": "^4.7.1",
"lcobucci/jwt": "4.1.5",
"lexik/form-filter-bundle": "^7.0.3",
"mgargano/simplehtmldom": "^1.5",
"mnapoli/piwik-twig-extension": "^3.0",
"nelmio/api-doc-bundle": "^4.10",
"nelmio/cors-bundle": "~2.2",
"nelmio/api-doc-bundle": "^4.11.1",
"nelmio/cors-bundle": "^2.3.1",
"ocramius/proxy-manager": "^2.1.1",
"pagerfanta/doctrine-orm-adapter": "^3.7",
"pagerfanta/twig": "^3.7",
"php-amqplib/php-amqplib": "^3.4",
"php-amqplib/rabbitmq-bundle": "^2.11",
"php-http/client-common": "^2.4",
"php-http/discovery": "^1.14",
"pagerfanta/doctrine-orm-adapter": "^3.8",
"pagerfanta/twig": "^3.8",
"php-amqplib/php-amqplib": "^3.6.1",
"php-amqplib/rabbitmq-bundle": "^2.14",
"php-http/client-common": "^2.7.1",
"php-http/discovery": "^1.19.2",
"php-http/guzzle5-adapter": "^2.0",
"php-http/httplug": "^2.3",
"php-http/httplug-bundle": "^1.14",
"php-http/message": "^1.13",
"php-http/message-factory": "^1.0",
"pragmarx/recovery": "^0.2.0",
"predis/predis": "^2.0.3",
"psr/http-message": "^1.0",
"psr/log": "^1.1",
"scheb/2fa-backup-code": "^5.13",
"scheb/2fa-bundle": "^5.13",
"scheb/2fa-email": "^5.13",
"scheb/2fa-google-authenticator": "^5.13",
"scheb/2fa-qr-code": "^5.13",
"scheb/2fa-trusted-device": "^5.13",
"sensio/framework-extra-bundle": "^6.2",
"sentry/sentry-symfony": "4.9.2",
"stof/doctrine-extensions-bundle": "^1.2",
"symfony/dom-crawler": "^4.0",
"symfony/mailer": "^4.0",
"symfony/monolog-bundle": "^3.1",
"symfony/proxy-manager-bridge": "^4.4",
"symfony/symfony": "^4.0",
"tecnickcom/tcpdf": "^6.3.0",
"twig/extra-bundle": "^3.4",
"twig/string-extra": "^3.4",
"twig/twig": "^3.4.3",
"wallabag/php-mobi": "~1.0",
"php-http/httplug": "^2.4",
"php-http/httplug-bundle": "^1.32",
"php-http/message": "^1.16",
"php-http/message-factory": "^1.1",
"pragmarx/recovery": "^0.2.1",
"predis/predis": "^2.2.2",
"psr/http-message": "^1.1",
"psr/log": "^1.1.4",
"scheb/2fa-backup-code": "^5.13.2",
"scheb/2fa-bundle": "^5.13.2",
"scheb/2fa-email": "^5.13.2",
"scheb/2fa-google-authenticator": "^5.13.2",
"scheb/2fa-qr-code": "^5.13.2",
"scheb/2fa-trusted-device": "^5.13.2",
"sensio/framework-extra-bundle": "^6.2.10",
"sentry/sentry-symfony": "^4.13.2",
"stof/doctrine-extensions-bundle": "^1.7.2",
"symfony/asset": "^4.4.46",
"symfony/config": "^4.4.44",
"symfony/console": "^4.4.49",
"symfony/debug": "^4.4.44",
"symfony/dependency-injection": "^4.4.49",
"symfony/doctrine-bridge": "^4.4.48",
"symfony/dom-crawler": "^4.4.45",
"symfony/error-handler": "^4.4.44",
"symfony/event-dispatcher": "^4.4.44",
"symfony/finder": "^4.4.44",
"symfony/form": "^4.4.48",
"symfony/framework-bundle": "^4.4.51",
"symfony/google-mailer": "^4.4.41",
"symfony/http-foundation": "^4.4.49",
"symfony/http-kernel": "^4.4.51",
"symfony/mailer": "^4.4.49",
"symfony/mime": "^4.4.47",
"symfony/monolog-bundle": "^3.8",
"symfony/options-resolver": "^4.4.44",
"symfony/proxy-manager-bridge": "^4.4.39",
"symfony/routing": "^4.4.44",
"symfony/security-bundle": "^4.4.50",
"symfony/security-core": "^4.4.48",
"symfony/security-http": "^4.4.50",
"symfony/templating": "^4.4.44",
"symfony/twig-bundle": "^4.4.41",
"symfony/validator": "^4.4.48",
"tecnickcom/tcpdf": "^6.6.5",
"twig/extra-bundle": "^3.7",
"twig/string-extra": "^3.8",
"twig/twig": "^3.8.0",
"wallabag/php-mobi": "^1.1.1",
"wallabag/phpepub": "^4.0.10",
"willdurand/hateoas": "^3.8",
"willdurand/hateoas-bundle": "~2.1"
"willdurand/hateoas": "^3.10",
"willdurand/hateoas-bundle": "^2.6"
},
"require-dev": {
"dama/doctrine-test-bundle": "^7.1",
"doctrine/doctrine-fixtures-bundle": "~3.0",
"ergebnis/composer-normalize": "^2.28",
"friendsofphp/php-cs-fixer": "~3.4",
"friendsoftwig/twigcs": "^6.0",
"m6web/redis-mock": "^5.0",
"php-http/mock-client": "^1.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-symfony": "^1.2",
"symfony/maker-bundle": "^1.18",
"symfony/phpunit-bridge": "~6.0"
"dama/doctrine-test-bundle": "^7.1.1",
"doctrine/doctrine-fixtures-bundle": "^3.4.5",
"ergebnis/composer-normalize": "^2.42",
"friendsofphp/php-cs-fixer": "^3.4",
"friendsoftwig/twigcs": "^6.1",
"m6web/redis-mock": "^5.6",
"php-http/mock-client": "^1.6",
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.58",
"phpstan/phpstan-doctrine": "^1.3.62",
"phpstan/phpstan-phpunit": "^1.3.15",
"phpstan/phpstan-symfony": "^1.3.7",
"symfony/browser-kit": "^4.4.44",
"symfony/css-selector": "^4.4.44",
"symfony/debug-bundle": "^4.4.37",
"symfony/maker-bundle": "^1.39.1",
"symfony/phpunit-bridge": "^6.4.3",
"symfony/var-dumper": "^4.4.47",
"symfony/web-profiler-bundle": "^4.4.47",
"symfony/web-server-bundle": "^4.4.44"
},
"suggest": {
"ext-imagick": "To keep GIF animation when downloading image is enabled"
@ -165,16 +193,13 @@
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
}
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
"ergebnis/composer-normalize": true,
"php-http/discovery": true,
"ergebnis/composer-normalize": true
"phpstan/extension-installer": true
},
"bin-dir": "bin",
"platform": {
@ -186,7 +211,11 @@
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"public-dir": "web"
"public-dir": "web",
"symfony": {
"allow-contrib": true,
"require": "4.4.*"
}
},
"scripts": {
"post-install-cmd": [

7435
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
FROM php:8.1-fpm AS rootless
FROM php:8.1-fpm-bookworm AS rootless
ARG DEBIAN_FRONTEND=noninteractive
ARG NODE_VERSION=16
ARG NODE_VERSION=20
RUN apt-get update \
&& apt-get install -y \
@ -33,8 +33,7 @@ RUN apt-get update && apt-get install -y \
zlib1g-dev \
git \
build-essential \
nodejs \
npm
nodejs
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
RUN docker-php-ext-install -j "$(nproc)" \
bcmath \

View File

@ -6,7 +6,7 @@ parameters:
database_name: ${DATABASE_NAME:-symfony}
database_user: ${DATABASE_USER:-root}
database_password: ${DATABASE_PASSWORD:-~}
database_path: '${DATABASE_PATH:-"%kernel.root_dir%/data/db/wallabag.sqlite"}'
database_path: '${DATABASE_PATH:-"%kernel.project_dir%/data/db/wallabag.sqlite"}'
database_table_prefix: ${DATABASE_TABLE_PREFIX:-wallabag_}
database_socket: null
database_charset: ${DATABASE_CHARSET:-utf8}

View File

@ -1,13 +1,13 @@
{
"name": "wallabag",
"version": "2.5.0",
"version": "2.6.0",
"description": "wallabag is a self hostable application for saving web pages",
"private": true,
"directories": {
"doc": "docs"
},
"engines": {
"node": ">=16"
"node": ">=20"
},
"repository": {
"type": "git",
@ -17,17 +17,22 @@
{
"name": "Nicolas Lœuillet",
"email": "nicolas@loeuillet.org",
"homepage": "http://www.cdetc.fr",
"homepage": "https://nicolas.loeuillet.org",
"role": "Developer"
},
{
"name": "Thomas Citharel",
"homepage": "http://tcit.fr",
"homepage": "https://tcit.fr",
"role": "Developer"
},
{
"name": "Jérémy Benoist",
"homepage": "http://www.j0k3r.net",
"homepage": "https://www.j0k3r.net",
"role": "Developer"
},
{
"name": "Kevin Decherf",
"homepage": "https://kdecherf.com/",
"role": "Developer"
}
],
@ -36,30 +41,30 @@
"url": "https://github.com/wallabag/wallabag/issues"
},
"devDependencies": {
"@babel/core": "^7.22.9",
"@babel/eslint-parser": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"autoprefixer": "^10.4.14",
"@babel/core": "^7.22.10",
"@babel/eslint-parser": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"autoprefixer": "^10.4.15",
"babel-loader": "^9.1.3",
"css-loader": "^6.8.1",
"eslint": "^8.45.0",
"eslint": "^8.47.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.28.1",
"eslint-webpack-plugin": "^4.0.1",
"file-loader": "^6.2.0",
"lato-font": "^3.0.0",
"mini-css-extract-plugin": "^2.7.6",
"node-sass": "^9.0.0",
"postcss": "^8.4.27",
"postcss": "^8.4.28",
"postcss-loader": "^7.3.3",
"postcss-scss": "^4.0.6",
"sass": "^1.64.1",
"postcss-scss": "^4.0.7",
"sass": "^1.66.1",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"stylelint": "^15.10.2",
"stylelint": "^15.10.3",
"stylelint-config-standard": "^34.0.0",
"stylelint-config-standard-scss": "^10.0.0",
"stylelint-scss": "^5.0.1",
"stylelint-scss": "^5.1.0",
"stylelint-webpack-plugin": "^4.1.1",
"terser-webpack-plugin": "^5.3.9",
"url-loader": "^4.1.1",
@ -79,7 +84,7 @@
"jquery.cookie": "^1.4.1",
"jr-qrcode": "^1.0.7",
"material-design-icons-iconfont": "^6.7.0",
"materialize-css": "^0.98.1",
"materialize-css": "^0.100.2",
"mathjax": "^3.2.2",
"mousetrap": "^1.6.0",
"ptsans-npm-webfont": "^0.0.4",

View File

@ -45,11 +45,6 @@ parameters:
count: 1
path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
-
message: "#^Call to method generate\\(\\) on an unknown class PHPUnit_Framework_MockObject_MockObject\\.$#"
count: 2
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
-
message: "#^Property Tests\\\\Wallabag\\\\CoreBundle\\\\Helper\\\\RedirectTest\\:\\:\\$routerMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#"
count: 1
@ -64,3 +59,13 @@ parameters:
message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser()#"
count: 7
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
-
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#"
count: 1
path: src/Wallabag/ImportBundle/Controller/HtmlController.php
-
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
count: 1
path: src/Wallabag/ImportBundle/Controller/HtmlController.php

View File

@ -7,3 +7,9 @@ if [ ! -f composer.phar ]; then
else
COMPOSER_COMMAND='./composer.phar'
fi
# Check for git
command -v git >/dev/null 2>&1 ||
{ echo >&2 "git is not installed. We can't install wallabag";
exit 1
}

View File

@ -7,7 +7,9 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Wallabag\AnnotationBundle\Entity\Annotation;
use Wallabag\CoreBundle\DataFixtures\EntryFixtures;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\UserBundle\DataFixtures\UserFixtures;
use Wallabag\UserBundle\Entity\User;
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
{
@ -16,8 +18,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
*/
public function load(ObjectManager $manager)
{
$annotation1 = new Annotation($this->getReference('admin-user'));
$annotation1->setEntry($this->getReference('entry1'));
$annotation1 = new Annotation($this->getReference('admin-user', User::class));
$annotation1->setEntry($this->getReference('entry1', Entry::class));
$annotation1->setText('This is my annotation /o/');
$annotation1->setQuote('content');
@ -25,8 +27,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
$this->addReference('annotation1', $annotation1);
$annotation2 = new Annotation($this->getReference('admin-user'));
$annotation2->setEntry($this->getReference('entry2'));
$annotation2 = new Annotation($this->getReference('admin-user', User::class));
$annotation2->setEntry($this->getReference('entry2', Entry::class));
$annotation2->setText('This is my 2nd annotation /o/');
$annotation2->setQuote('content');
@ -34,8 +36,8 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
$this->addReference('annotation2', $annotation2);
$annotation3 = new Annotation($this->getReference('bob-user'));
$annotation3->setEntry($this->getReference('entry3'));
$annotation3 = new Annotation($this->getReference('bob-user', User::class));
$annotation3->setEntry($this->getReference('entry3', Entry::class));
$annotation3->setText('This is my first annotation !');
$annotation3->setQuote('content');

View File

@ -152,6 +152,12 @@ class AnnotationRepository extends ServiceEntityRepository
->getResult();
}
public function getCountBuilderByUser($userId = null)
{
return $this->createQueryBuilder('e')
->andWhere('e.user = :userId')->setParameter('userId', $userId);
}
/**
* Return a query builder to used by other getBuilderFor* method.
*

View File

@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\ApiBundle\Entity\Client;
@ -69,12 +70,16 @@ class DeveloperController extends AbstractController
/**
* Remove a client.
*
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client", methods={"POST"})
*
* @return RedirectResponse
*/
public function deleteClientAction(Client $client, EntityManagerInterface $entityManager, TranslatorInterface $translator)
public function deleteClientAction(Request $request, Client $client, EntityManagerInterface $entityManager, TranslatorInterface $translator)
{
if (!$this->isCsrfTokenValid('delete-client', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
if (null === $this->getUser() || $client->getUser()->getId() !== $this->getUser()->getId()) {
throw $this->createAccessDeniedException('You can not access this client.');
}
@ -99,6 +104,9 @@ class DeveloperController extends AbstractController
*/
public function howtoFirstAppAction()
{
return $this->render('@WallabagCore/Developer/howto_app.html.twig');
return $this->render('@WallabagCore/Developer/howto_app.html.twig',
[
'wallabag_url' => $this->getParameter('domain_name'),
]);
}
}

View File

@ -269,6 +269,16 @@ class EntryRestController extends WallabagRestController
* example="example.com",
* )
* ),
* @OA\Parameter(
* name="annotations",
* in="query",
* description="filter by entries with annotations. Use 1 for entries with annotations, 0 for entries without annotations. All entries by default",
* required=false,
* @OA\Schema(
* type="integer",
* enum={"1", "0"}
* )
* ),
* @OA\Response(
* response="200",
* description="Returned when successful"
@ -294,6 +304,7 @@ class EntryRestController extends WallabagRestController
$since = $request->query->get('since', 0);
$detail = strtolower($request->query->get('detail', 'full'));
$domainName = (null === $request->query->get('domain_name')) ? '' : (string) $request->query->get('domain_name');
$hasAnnotations = (null === $request->query->get('annotations')) ? null : (bool) $request->query->get('annotations');
try {
/** @var Pagerfanta $pager */
@ -307,7 +318,8 @@ class EntryRestController extends WallabagRestController
$since,
$tags,
$detail,
$domainName
$domainName,
$hasAnnotations
);
} catch (\Exception $e) {
throw new BadRequestHttpException($e->getMessage());
@ -332,6 +344,7 @@ class EntryRestController extends WallabagRestController
'tags' => $tags,
'since' => $since,
'detail' => $detail,
'annotations' => $hasAnnotations,
],
true
)
@ -489,7 +502,7 @@ class EntryRestController extends WallabagRestController
* @OA\Parameter(
* name="urls",
* in="query",
* description="Urls (as an array) to create. A JSON array of urls [{'url': 'http://...'}, {'url': 'http://...'}]",
* description="Urls (as an array) to create. A JSON array of urls ['http://...', 'http://...']",
* required=true,
* @OA\Schema(type="string")
* ),

View File

@ -4,6 +4,9 @@ namespace Wallabag\CoreBundle\Command;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Event\UserEvent;
use FOS\UserBundle\FOSUserEvents;
@ -138,7 +141,7 @@ class InstallCommand extends Command
$help = '';
// now check if MySQL isn't too old to handle utf8mb4
if ($conn->isConnected() && 'mysql' === $conn->getDatabasePlatform()->getName()) {
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof MySQLPlatform) {
$version = $conn->query('select version()')->fetchOne();
$minimalVersion = '5.5.4';
@ -150,7 +153,7 @@ class InstallCommand extends Command
}
// testing if PostgreSQL > 9.1
if ($conn->isConnected() && 'postgresql' === $conn->getDatabasePlatform()->getName()) {
if ($conn->isConnected() && $conn->getDatabasePlatform() instanceof PostgreSQLPlatform) {
// return version should be like "PostgreSQL 9.5.4 on x86_64-apple-darwin15.6.0, compiled by Apple LLVM version 8.0.0 (clang-800.0.38), 64-bit"
$version = $conn->query('SELECT version();')->fetchOne();
@ -372,27 +375,26 @@ class InstallCommand extends Command
private function isDatabasePresent()
{
$connection = $this->entityManager->getConnection();
$databaseName = $connection->getDatabase();
try {
$databaseName = $connection->getDatabase();
$schemaManager = $connection->getSchemaManager();
} catch (\Exception $exception) {
// mysql & sqlite
if (false !== strpos($exception->getMessage(), 'Unknown database')) {
if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) {
return false;
}
// pgsql
if (false !== strpos($exception->getMessage(), 'does not exist')) {
if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) {
return false;
}
throw $exception;
}
$schemaManager = $connection->getSchemaManager();
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
if ('sqlite' === $schemaManager->getDatabasePlatform()->getName()) {
if ($connection->getDatabasePlatform() instanceof SqlitePlatform) {
$params = $connection->getParams();
if (isset($params['path']) && file_exists($params['path'])) {

View File

@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
@ -32,6 +33,7 @@ use Wallabag\CoreBundle\Form\Type\IgnoreOriginUserRuleType;
use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType;
use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
use Wallabag\CoreBundle\Form\Type\UserInformationType;
use Wallabag\CoreBundle\Helper\Redirect;
use Wallabag\CoreBundle\Repository\ConfigRepository;
use Wallabag\CoreBundle\Repository\EntryRepository;
use Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository;
@ -48,8 +50,9 @@ class ConfigController extends AbstractController
private TagRepository $tagRepository;
private AnnotationRepository $annotationRepository;
private ConfigRepository $configRepository;
private Redirect $redirectHelper;
public function __construct(EntityManagerInterface $entityManager, UserManagerInterface $userManager, EntryRepository $entryRepository, TagRepository $tagRepository, AnnotationRepository $annotationRepository, ConfigRepository $configRepository)
public function __construct(EntityManagerInterface $entityManager, UserManagerInterface $userManager, EntryRepository $entryRepository, TagRepository $tagRepository, AnnotationRepository $annotationRepository, ConfigRepository $configRepository, Redirect $redirectHelper)
{
$this->entityManager = $entityManager;
$this->userManager = $userManager;
@ -57,6 +60,7 @@ class ConfigController extends AbstractController
$this->tagRepository = $tagRepository;
$this->annotationRepository = $annotationRepository;
$this->configRepository = $configRepository;
$this->redirectHelper = $redirectHelper;
}
/**
@ -254,10 +258,14 @@ class ConfigController extends AbstractController
/**
* Disable 2FA using email.
*
* @Route("/config/otp/email/disable", name="disable_otp_email")
* @Route("/config/otp/email/disable", name="disable_otp_email", methods={"POST"})
*/
public function disableOtpEmailAction()
public function disableOtpEmailAction(Request $request)
{
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$user = $this->getUser();
$user->setEmailTwoFactor(false);
@ -274,10 +282,14 @@ class ConfigController extends AbstractController
/**
* Enable 2FA using email.
*
* @Route("/config/otp/email", name="config_otp_email")
* @Route("/config/otp/email", name="config_otp_email", methods={"POST"})
*/
public function otpEmailAction()
public function otpEmailAction(Request $request)
{
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$user = $this->getUser();
$user->setGoogleAuthenticatorSecret(null);
@ -297,10 +309,14 @@ class ConfigController extends AbstractController
/**
* Disable 2FA using OTP app.
*
* @Route("/config/otp/app/disable", name="disable_otp_app")
* @Route("/config/otp/app/disable", name="disable_otp_app", methods={"POST"})
*/
public function disableOtpAppAction()
public function disableOtpAppAction(Request $request)
{
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$user = $this->getUser();
$user->setGoogleAuthenticatorSecret('');
@ -319,10 +335,14 @@ class ConfigController extends AbstractController
/**
* Enable 2FA using OTP app, user will need to confirm the generated code from the app.
*
* @Route("/config/otp/app", name="config_otp_app")
* @Route("/config/otp/app", name="config_otp_app", methods={"POST"})
*/
public function otpAppAction(GoogleAuthenticatorInterface $googleAuthenticator)
public function otpAppAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
{
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$user = $this->getUser();
$secret = $googleAuthenticator->generateSecret();
@ -357,8 +377,10 @@ class ConfigController extends AbstractController
* Cancelling 2FA using OTP app.
*
* @Route("/config/otp/app/cancel", name="config_otp_app_cancel")
*
* XXX: commented until we rewrite 2fa with a real two-steps activation
*/
public function otpAppCancelAction()
/*public function otpAppCancelAction()
{
$user = $this->getUser();
$user->setGoogleAuthenticatorSecret(null);
@ -367,21 +389,27 @@ class ConfigController extends AbstractController
$this->userManager->updateUser($user, true);
return $this->redirect($this->generateUrl('config') . '#set3');
}
}*/
/**
* Validate OTP code.
*
* @Route("/config/otp/app/check", name="config_otp_app_check")
* @Route("/config/otp/app/check", name="config_otp_app_check", methods={"POST"})
*/
public function otpAppCheckAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
{
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$user = $this->getUser();
$isValid = $googleAuthenticator->checkCode(
$this->getUser(),
$user,
$request->get('_auth_code')
);
if (true === $isValid) {
if ($isValid) {
$this->addFlash(
'notice',
'flashes.config.notice.otp_enabled'
@ -391,30 +419,35 @@ class ConfigController extends AbstractController
}
$this->addFlash(
'two_factor',
'scheb_two_factor.code_invalid'
'notice',
'flashes.config.notice.otp_code_invalid'
);
return $this->redirect($this->generateUrl('config_otp_app'));
$user->setGoogleAuthenticatorSecret(null);
$user->setBackupCodes(null);
$this->userManager->updateUser($user, true);
return $this->redirect($this->generateUrl('config') . '#set3');
}
/**
* @Route("/generate-token", name="generate_token")
* @Route("/generate-token", name="generate_token", methods={"POST"})
*
* @return RedirectResponse|JsonResponse
*/
public function generateTokenAction(Request $request)
{
if (!$this->isCsrfTokenValid('generate-token', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$config = $this->getConfig();
$config->setFeedToken(Utils::generateToken());
$this->entityManager->persist($config);
$this->entityManager->flush();
if ($request->isXmlHttpRequest()) {
return new JsonResponse(['token' => $config->getFeedToken()]);
}
$this->addFlash(
'notice',
'flashes.config.notice.feed_token_updated'
@ -424,22 +457,22 @@ class ConfigController extends AbstractController
}
/**
* @Route("/revoke-token", name="revoke_token")
* @Route("/revoke-token", name="revoke_token", methods={"POST"})
*
* @return RedirectResponse|JsonResponse
*/
public function revokeTokenAction(Request $request)
{
if (!$this->isCsrfTokenValid('revoke-token', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$config = $this->getConfig();
$config->setFeedToken(null);
$this->entityManager->persist($config);
$this->entityManager->flush();
if ($request->isXmlHttpRequest()) {
return new JsonResponse();
}
$this->addFlash(
'notice',
'flashes.config.notice.feed_token_revoked'
@ -451,12 +484,16 @@ class ConfigController extends AbstractController
/**
* Deletes a tagging rule and redirect to the config homepage.
*
* @Route("/tagging-rule/delete/{id}", requirements={"id" = "\d+"}, name="delete_tagging_rule")
* @Route("/tagging-rule/delete/{id}", name="delete_tagging_rule", methods={"POST"}, requirements={"id" = "\d+"})
*
* @return RedirectResponse
*/
public function deleteTaggingRuleAction(TaggingRule $rule)
public function deleteTaggingRuleAction(Request $request, TaggingRule $rule)
{
if (!$this->isCsrfTokenValid('delete-tagging-rule', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->validateRuleAction($rule);
$this->entityManager->remove($rule);
@ -487,12 +524,16 @@ class ConfigController extends AbstractController
/**
* Deletes an ignore origin rule and redirect to the config homepage.
*
* @Route("/ignore-origin-user-rule/delete/{id}", requirements={"id" = "\d+"}, name="delete_ignore_origin_rule")
* @Route("/ignore-origin-user-rule/delete/{id}", name="delete_ignore_origin_rule", methods={"POST"}, requirements={"id" = "\d+"})
*
* @return RedirectResponse
*/
public function deleteIgnoreOriginRuleAction(IgnoreOriginUserRule $rule)
public function deleteIgnoreOriginRuleAction(Request $request, IgnoreOriginUserRule $rule)
{
if (!$this->isCsrfTokenValid('delete-ignore-origin-rule', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->validateRuleAction($rule);
$this->entityManager->remove($rule);
@ -523,12 +564,16 @@ class ConfigController extends AbstractController
/**
* Remove all annotations OR tags OR entries for the current user.
*
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset")
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset", methods={"POST"})
*
* @return RedirectResponse
*/
public function resetAction(string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
public function resetAction(Request $request, string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
{
if (!$this->isCsrfTokenValid('reset-area', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
switch ($type) {
case 'annotations':
$annotationRepository->removeAllByUserId($this->getUser()->getId());
@ -580,7 +625,7 @@ class ConfigController extends AbstractController
public function deleteAccountAction(Request $request, UserRepository $userRepository, TokenStorageInterface $tokenStorage)
{
if (!$this->isCsrfTokenValid('delete-account', $request->request->get('token'))) {
throw $this->createAccessDeniedException('Bad CSRF token.');
throw new BadRequestHttpException('Bad CSRF token.');
}
$enabledUsers = $userRepository->getSumEnabledUsers();
@ -603,19 +648,25 @@ class ConfigController extends AbstractController
/**
* Switch view mode for current user.
*
* @Route("/config/view-mode", name="switch_view_mode")
* @Route("/config/view-mode", name="switch_view_mode", methods={"POST"})
*
* @return RedirectResponse
*/
public function changeViewModeAction(Request $request)
{
if (!$this->isCsrfTokenValid('switch-view-mode', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$user = $this->getUser();
$user->getConfig()->setListMode(!$user->getConfig()->getListMode());
$this->entityManager->persist($user);
$this->entityManager->flush();
return $this->redirect($request->headers->get('referer'));
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
return $this->redirect($redirectUrl);
}
/**
@ -623,12 +674,16 @@ class ConfigController extends AbstractController
*
* @param string $language
*
* @Route("/locale/{language}", name="changeLocale")
* @Route("/locale/{language}", name="changeLocale", methods={"POST"})
*
* @return RedirectResponse
*/
public function setLocaleAction(Request $request, ValidatorInterface $validator, $language = null)
{
if (!$this->isCsrfTokenValid('change-locale', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$errors = $validator->validate($language, (new LocaleConstraint()));
if (0 === \count($errors)) {

View File

@ -14,8 +14,8 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
@ -53,12 +53,16 @@ class EntryController extends AbstractController
}
/**
* @Route("/mass", name="mass_action")
* @Route("/mass", name="mass_action", methods={"POST"})
*
* @return Response
*/
public function massAction(Request $request, TagRepository $tagRepository)
{
if (!$this->isCsrfTokenValid('mass-action', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$values = $request->request->all();
$tagsToAdd = [];
@ -128,7 +132,7 @@ class EntryController extends AbstractController
$this->entityManager->flush();
}
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
return $this->redirect($redirectUrl);
}
@ -401,12 +405,16 @@ class EntryController extends AbstractController
* Reload an entry.
* Refetch content from the website and make it readable again.
*
* @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry")
* @Route("/reload/{id}", name="reload_entry", methods={"POST"}, requirements={"id" = "\d+"})
*
* @return RedirectResponse
*/
public function reloadAction(Entry $entry)
public function reloadAction(Request $request, Entry $entry)
{
if (!$this->isCsrfTokenValid('reload-entry', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->checkUserAction($entry);
$this->updateEntry($entry, 'entry_reloaded');
@ -430,12 +438,16 @@ class EntryController extends AbstractController
/**
* Changes read status for an entry.
*
* @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry")
* @Route("/archive/{id}", name="archive_entry", methods={"POST"}, requirements={"id" = "\d+"})
*
* @return RedirectResponse
*/
public function toggleArchiveAction(Request $request, Entry $entry)
{
if (!$this->isCsrfTokenValid('archive-entry', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->checkUserAction($entry);
$entry->toggleArchive();
@ -451,7 +463,7 @@ class EntryController extends AbstractController
$message
);
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
return $this->redirect($redirectUrl);
}
@ -459,12 +471,16 @@ class EntryController extends AbstractController
/**
* Changes starred status for an entry.
*
* @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry")
* @Route("/star/{id}", name="star_entry", methods={"POST"}, requirements={"id" = "\d+"})
*
* @return RedirectResponse
*/
public function toggleStarAction(Request $request, Entry $entry)
{
if (!$this->isCsrfTokenValid('star-entry', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->checkUserAction($entry);
$entry->toggleStar();
@ -481,7 +497,7 @@ class EntryController extends AbstractController
$message
);
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'));
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'));
return $this->redirect($redirectUrl);
}
@ -489,20 +505,23 @@ class EntryController extends AbstractController
/**
* Deletes entry and redirect to the homepage or the last viewed page.
*
* @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry")
* @Route("/delete/{id}", name="delete_entry", methods={"POST"}, requirements={"id" = "\d+"})
*
* @return RedirectResponse
*/
public function deleteEntryAction(Request $request, Entry $entry)
{
if (!$this->isCsrfTokenValid('delete-entry', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->checkUserAction($entry);
// generates the view url for this entry to check for redirection later
// to avoid redirecting to the deleted entry. Ugh.
$url = $this->generateUrl(
'view',
['id' => $entry->getId()],
UrlGeneratorInterface::ABSOLUTE_PATH
['id' => $entry->getId()]
);
// entry deleted, dispatch event about it!
@ -517,8 +536,8 @@ class EntryController extends AbstractController
);
// don't redirect user to the deleted entry (check that the referer doesn't end with the same url)
$referer = $request->headers->get('referer');
$to = (1 !== preg_match('#' . $url . '$#i', $referer) ? $referer : null);
$prev = $request->query->get('redirect', '');
$to = (1 !== preg_match('#' . $url . '$#i', $prev) ? $prev : null);
$redirectUrl = $this->redirectHelper->to($to);
@ -528,12 +547,16 @@ class EntryController extends AbstractController
/**
* Get public URL for entry (and generate it if necessary).
*
* @Route("/share/{id}", requirements={"id" = "\d+"}, name="share")
* @Route("/share/{id}", name="share", methods={"POST"}, requirements={"id" = "\d+"})
*
* @return Response
*/
public function shareAction(Entry $entry)
public function shareAction(Request $request, Entry $entry)
{
if (!$this->isCsrfTokenValid('share-entry', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->checkUserAction($entry);
if (null === $entry->getUid()) {
@ -551,12 +574,16 @@ class EntryController extends AbstractController
/**
* Disable public sharing for an entry.
*
* @Route("/share/delete/{id}", requirements={"id" = "\d+"}, name="delete_share")
* @Route("/share/delete/{id}", name="delete_share", methods={"POST"}, requirements={"id" = "\d+"})
*
* @return Response
*/
public function deleteShareAction(Entry $entry)
public function deleteShareAction(Request $request, Entry $entry)
{
if (!$this->isCsrfTokenValid('delete-share', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->checkUserAction($entry);
$entry->cleanUid();
@ -572,7 +599,7 @@ class EntryController extends AbstractController
/**
* Ability to view a content publicly.
*
* @Route("/share/{uid}", requirements={"uid" = ".+"}, name="share_entry")
* @Route("/share/{uid}", name="share_entry", methods={"GET"}, requirements={"uid" = ".+"})
* @Cache(maxage="25200", smaxage="25200", public=true)
*
* @return Response
@ -594,7 +621,7 @@ class EntryController extends AbstractController
*
* @param int $page
*
* @Route("/domain/{id}/{page}", requirements={"id" = ".+"}, defaults={"page" = 1}, name="same_domain")
* @Route("/domain/{id}/{page}", requirements={"id" = "\d+"}, defaults={"page" = 1}, name="same_domain")
*
* @return Response
*/
@ -673,9 +700,6 @@ class EntryController extends AbstractController
}
}
$nbEntriesUntagged = $this->entryRepository
->countUntaggedEntriesByUser($this->getUser()->getId());
return $this->render(
'@WallabagCore/Entry/entries.html.twig', [
'form' => $form->createView(),
@ -683,7 +707,6 @@ class EntryController extends AbstractController
'currentPage' => $page,
'searchTerm' => $searchTerm,
'isFiltered' => $form->isSubmitted(),
'nbEntriesUntagged' => $nbEntriesUntagged,
]
);
}

View File

@ -1,40 +0,0 @@
<?php
namespace Wallabag\CoreBundle\Controller;
use Symfony\Bundle\TwigBundle\Controller\ExceptionController as BaseExceptionController;
use Symfony\Component\HttpFoundation\Request;
/**
* This controller allow us to customize the error template.
* The only modified line from the parent template is for "WallabagCoreBundle".
*/
class ExceptionController extends BaseExceptionController
{
protected function findTemplate(Request $request, $format, $code, $showException)
{
$name = $showException ? 'exception' : 'error';
if ($showException && 'html' === $format) {
$name = 'exception_full';
}
// For error pages, try to find a template for the specific HTTP status code and format
if (!$showException) {
$template = sprintf('@WallabagCore/Exception/%s.%s.twig', $name, $format);
if ($this->templateExists($template)) {
return $template;
}
}
// try to find a template for the given format
$template = sprintf('@Twig/Exception/%s.%s.twig', $name, $format);
if ($this->templateExists($template)) {
return $template;
}
// default to a generic HTML exception
$request->setRequestFormat('html');
return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name);
}
}

View File

@ -10,6 +10,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Entity\Entry;
@ -45,7 +46,7 @@ class TagController extends AbstractController
$form = $this->createForm(NewTagType::class, new Tag());
$form->handleRequest($request);
$tags = $form->get('label')->getData();
$tags = $form->get('label')->getData() ?? '';
$tagsExploded = explode(',', $tags);
// avoid too much tag to be added
@ -87,12 +88,16 @@ class TagController extends AbstractController
/**
* Removes tag from entry.
*
* @Route("/remove-tag/{entry}/{tag}", requirements={"entry" = "\d+", "tag" = "\d+"}, name="remove_tag")
* @Route("/remove-tag/{entry}/{tag}", name="remove_tag", methods={"POST"}, requirements={"entry" = "\d+", "tag" = "\d+"})
*
* @return Response
*/
public function removeTagFromEntry(Request $request, Entry $entry, Tag $tag)
{
if (!$this->isCsrfTokenValid('remove-tag', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$this->checkUserAction($entry);
$entry->removeTag($tag);
@ -104,7 +109,7 @@ class TagController extends AbstractController
$this->entityManager->flush();
}
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true);
return $this->redirect($redirectUrl);
}
@ -185,7 +190,7 @@ class TagController extends AbstractController
$form = $this->createForm(RenameTagType::class, new Tag());
$form->handleRequest($request);
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true);
if ($form->isSubmitted() && $form->isValid()) {
$newTag = new Tag();
@ -228,12 +233,16 @@ class TagController extends AbstractController
/**
* Tag search results with the current search term.
*
* @Route("/tag/search/{filter}", name="tag_this_search")
* @Route("/tag/search/{filter}", name="tag_this_search", methods={"POST"})
*
* @return Response
*/
public function tagThisSearchAction($filter, Request $request, EntryRepository $entryRepository)
{
if (!$this->isCsrfTokenValid('tag-this-search', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
$currentRoute = $request->query->has('currentRoute') ? $request->query->get('currentRoute') : '';
/** @var QueryBuilder $qb */
@ -257,19 +266,23 @@ class TagController extends AbstractController
$this->entityManager->flush();
}
return $this->redirect($this->redirectHelper->to($request->headers->get('referer'), '', true));
return $this->redirect($this->redirectHelper->to($request->query->get('redirect'), true));
}
/**
* Delete a given tag for the current user.
*
* @Route("/tag/delete/{slug}", name="tag_delete")
* @Route("/tag/delete/{slug}", name="tag_delete", methods={"POST"})
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
*
* @return Response
*/
public function removeTagAction(Tag $tag, Request $request, EntryRepository $entryRepository)
{
if (!$this->isCsrfTokenValid('tag-delete', $request->request->get('token'))) {
throw new BadRequestHttpException('Bad CSRF token.');
}
foreach ($tag->getEntriesByUserId($this->getUser()->getId()) as $entry) {
$entryRepository->removeTag($this->getUser()->getId(), $tag);
}
@ -279,8 +292,7 @@ class TagController extends AbstractController
$this->entityManager->remove($tag);
$this->entityManager->flush();
}
$redirectUrl = $this->redirectHelper->to($request->headers->get('referer'), '', true);
$redirectUrl = $this->redirectHelper->to($request->query->get('redirect'), true);
return $this->redirect($redirectUrl);
}

View File

@ -7,6 +7,7 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\UserBundle\DataFixtures\UserFixtures;
use Wallabag\UserBundle\Entity\User;
class ConfigFixtures extends Fixture implements DependentFixtureInterface
{
@ -15,7 +16,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
*/
public function load(ObjectManager $manager): void
{
$adminConfig = new Config($this->getReference('admin-user'));
$adminConfig = new Config($this->getReference('admin-user', User::class));
$adminConfig->setItemsPerPage(30);
$adminConfig->setReadingSpeed(200);
@ -29,7 +30,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
$this->addReference('admin-config', $adminConfig);
$bobConfig = new Config($this->getReference('bob-user'));
$bobConfig = new Config($this->getReference('bob-user', User::class));
$bobConfig->setItemsPerPage(10);
$bobConfig->setReadingSpeed(200);
$bobConfig->setLanguage('fr');
@ -42,7 +43,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
$this->addReference('bob-config', $bobConfig);
$emptyConfig = new Config($this->getReference('empty-user'));
$emptyConfig = new Config($this->getReference('empty-user', User::class));
$emptyConfig->setItemsPerPage(10);
$emptyConfig->setReadingSpeed(100);
$emptyConfig->setLanguage('en');

View File

@ -6,7 +6,9 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\UserBundle\DataFixtures\UserFixtures;
use Wallabag\UserBundle\Entity\User;
class EntryFixtures extends Fixture implements DependentFixtureInterface
{
@ -87,7 +89,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
];
foreach ($entries as $reference => $item) {
$entry = new Entry($this->getReference($item['user']));
$entry = new Entry($this->getReference($item['user'], User::class));
$entry->setUrl($item['url']);
$entry->setReadingTime($item['reading_time']);
$entry->setDomainName($item['domain']);
@ -98,7 +100,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
if (isset($item['tags'])) {
foreach ($item['tags'] as $tag) {
$entry->addTag($this->getReference($tag));
$entry->addTag($this->getReference($tag, Tag::class));
}
}

View File

@ -7,6 +7,7 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
use Wallabag\UserBundle\DataFixtures\UserFixtures;
use Wallabag\UserBundle\Entity\User;
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
{
@ -17,7 +18,7 @@ class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureIn
{
$rule = new IgnoreOriginUserRule();
$rule->setRule('host = "example.fr"');
$rule->setConfig($this->getReference('admin-user')->getConfig());
$rule->setConfig($this->getReference('admin-user', User::class)->getConfig());
$manager->persist($rule);

View File

@ -10,6 +10,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
use Wallabag\CoreBundle\Entity\SiteCredential;
use Wallabag\CoreBundle\Helper\CryptoProxy;
use Wallabag\UserBundle\DataFixtures\UserFixtures;
use Wallabag\UserBundle\Entity\User;
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
{
@ -28,14 +29,14 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac
*/
public function load(ObjectManager $manager): void
{
$credential = new SiteCredential($this->getReference('admin-user'));
$credential = new SiteCredential($this->getReference('admin-user', User::class));
$credential->setHost('.super.com');
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('.super'));
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));
$manager->persist($credential);
$credential = new SiteCredential($this->getReference('admin-user'));
$credential = new SiteCredential($this->getReference('admin-user', User::class));
$credential->setHost('paywall.example.com');
$credential->setUsername($this->container->get(CryptoProxy::class)->crypt('paywall.example'));
$credential->setPassword($this->container->get(CryptoProxy::class)->crypt('bar'));

View File

@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\TaggingRule;
class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
@ -17,14 +18,14 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
$tr1 = new TaggingRule();
$tr1->setRule('content matches "spurs"');
$tr1->setTags(['sport']);
$tr1->setConfig($this->getReference('admin-config'));
$tr1->setConfig($this->getReference('admin-config', Config::class));
$manager->persist($tr1);
$tr2 = new TaggingRule();
$tr2->setRule('content matches "basket"');
$tr2->setTags(['sport']);
$tr2->setConfig($this->getReference('admin-config'));
$tr2->setConfig($this->getReference('admin-config', Config::class));
$manager->persist($tr2);
@ -32,28 +33,28 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
$tr3->setRule('title matches "wallabag"');
$tr3->setTags(['wallabag']);
$tr3->setConfig($this->getReference('admin-config'));
$tr3->setConfig($this->getReference('admin-config', Config::class));
$manager->persist($tr3);
$tr4 = new TaggingRule();
$tr4->setRule('content notmatches "basket"');
$tr4->setTags(['foot']);
$tr4->setConfig($this->getReference('admin-config'));
$tr4->setConfig($this->getReference('admin-config', Config::class));
$manager->persist($tr4);
$tr5 = new TaggingRule();
$tr5->setRule('readingTime <= 5');
$tr5->setTags(['shortread']);
$tr5->setConfig($this->getReference('empty-config'));
$tr5->setConfig($this->getReference('empty-config', Config::class));
$manager->persist($tr5);
$tr6 = new TaggingRule();
$tr6->setRule('readingTime > 5');
$tr6->setTags(['longread']);
$tr6->setConfig($this->getReference('empty-config'));
$tr6->setConfig($this->getReference('empty-config', Config::class));
$manager->persist($tr6);

View File

@ -2,6 +2,7 @@
namespace Wallabag\CoreBundle\Doctrine;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
@ -49,7 +50,7 @@ abstract class WallabagMigration extends AbstractMigration implements ContainerA
}
// escape table name is handled using " on postgresql
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
return '"' . $table . '"';
}

View File

@ -14,6 +14,7 @@ use Symfony\Component\Validator\Constraints as Assert;
use Wallabag\AnnotationBundle\Entity\Annotation;
use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
use Wallabag\CoreBundle\Helper\UrlHasher;
use Wallabag\CoreBundle\Tools\Utils;
use Wallabag\UserBundle\Entity\User;
/**
@ -658,6 +659,14 @@ class Entry
$this->readingTime = $readingTime;
}
/**
* @return float
*/
public function getUserReadingTime()
{
return round($this->readingTime / $this->getUser()->getConfig()->getReadingSpeed() * Utils::DEFAULT_WORDS_PER_MINUTE);
}
/**
* @return string
*/

View File

@ -3,7 +3,7 @@
namespace Wallabag\CoreBundle\Event\Listener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
/**
@ -18,7 +18,7 @@ class LocaleListener implements EventSubscriberInterface
$this->defaultLocale = $defaultLocale;
}
public function onKernelRequest(GetResponseEvent $event)
public function onKernelRequest(RequestEvent $event)
{
$request = $event->getRequest();
if (!$request->hasPreviousSession()) {

View File

@ -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\ChoiceFilterType;
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\TextFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
@ -15,6 +16,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Wallabag\CoreBundle\Repository\EntryRepository;
use Wallabag\CoreBundle\Tools\Utils;
use Wallabag\UserBundle\Entity\User;
class EntryFilterType extends AbstractType
@ -56,8 +58,8 @@ class EntryFilterType extends AbstractType
return;
}
$min = (int) ($lower * $user->getConfig()->getReadingSpeed() / 200);
$max = (int) ($upper * $user->getConfig()->getReadingSpeed() / 200);
$min = (int) ($lower * $user->getConfig()->getReadingSpeed() / Utils::DEFAULT_WORDS_PER_MINUTE);
$max = (int) ($upper * $user->getConfig()->getReadingSpeed() / Utils::DEFAULT_WORDS_PER_MINUTE);
if (null === $lower && null !== $upper) {
// only lower value is defined: query all entries with reading LOWER THAN this value
@ -102,10 +104,13 @@ class EntryFilterType extends AbstractType
return $filterQuery->createCondition($expression);
},
'label' => 'entry.filters.domain_label',
'attr' => [
'autocapitalize' => 'off',
],
])
->add('httpStatus', TextFilterType::class, [
->add('httpStatus', NumberFilterType::class, [
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
$value = $values['value'];
$value = (int) $values['value'];
if (false === \array_key_exists($value, Response::$statusTexts)) {
return false;
}
@ -117,6 +122,11 @@ class EntryFilterType extends AbstractType
return $filterQuery->createCondition($expression, $parameters);
},
'label' => 'entry.filters.http_status_label',
'html5' => true,
'attr' => [
'min' => 100,
'max' => 527,
],
])
->add('isArchived', CheckboxFilterType::class, [
'label' => 'entry.filters.archived_label',

View File

@ -4,7 +4,6 @@ namespace Wallabag\CoreBundle\Form\Type;
use FOS\UserBundle\Form\Type\RegistrationFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
@ -23,15 +22,6 @@ class UserInformationType extends AbstractType
->add('email', EmailType::class, [
'label' => 'config.form_user.email_label',
])
->add('emailTwoFactor', CheckboxType::class, [
'required' => false,
'label' => 'config.form_user.emailTwoFactor_label',
])
->add('googleTwoFactor', CheckboxType::class, [
'required' => false,
'label' => 'config.form_user.googleTwoFactor_label',
'mapped' => false,
])
->add('save', SubmitType::class, [
'label' => 'config.form.save',
])

View File

@ -9,10 +9,11 @@ use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\Plugin\ErrorPlugin;
use Http\Client\Common\Plugin\RedirectPlugin;
use Http\Client\Common\PluginClient;
use Http\Client\HttpClient;
use Http\Discovery\MessageFactoryDiscovery;
use Http\Message\MessageFactory;
use Http\Discovery\Psr17FactoryDiscovery;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DomCrawler\Crawler;
use Symfony\Component\Finder\Finder;
@ -28,9 +29,9 @@ class DownloadImages
private $mimeTypes;
private $wallabagUrl;
public function __construct(HttpClient $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, MessageFactory $messageFactory = null)
public function __construct(ClientInterface $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, RequestFactoryInterface $requestFactory = null, StreamFactoryInterface $streamFactory = null)
{
$this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin(), new RedirectPlugin()]), $messageFactory ?: MessageFactoryDiscovery::find());
$this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin(), new RedirectPlugin()]), $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory(), $streamFactory ?: Psr17FactoryDiscovery::findStreamFactory());
$this->baseFolder = $baseFolder;
$this->wallabagUrl = rtrim($wallabagUrl, '/');
$this->logger = $logger;

View File

@ -210,7 +210,7 @@ class EntriesExport
$publishedDate = $entry->getPublishedAt()->format('Y-m-d');
}
$readingTime = round($entry->getReadingTime() / $user->getConfig()->getReadingSpeed() * 200);
$readingTime = $entry->getUserReadingTime();
$titlepage = $content_start .
'<h1>' . $entry->getTitle() . '</h1>' .
@ -331,7 +331,7 @@ class EntriesExport
$authors = implode(',', $publishedBy);
}
$readingTime = $entry->getReadingTime() / $user->getConfig()->getReadingSpeed() * 200;
$readingTime = $entry->getUserReadingTime();
$pdf->addPage();
$html = '<h1>' . $entry->getTitle() . '</h1>' .

View File

@ -2,6 +2,7 @@
namespace Wallabag\CoreBundle\Helper;
use GuzzleHttp\Psr7\Uri;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Wallabag\CoreBundle\Entity\Config;
@ -23,16 +24,23 @@ class Redirect
/**
* @param string $url URL to redirect
* @param string $fallback Fallback URL if $url is null
* @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
*
* @return string
*/
public function to($url, $fallback = '', $ignoreActionMarkAsRead = false)
public function to($url, $ignoreActionMarkAsRead = false)
{
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
if (!$user instanceof User) {
if (null === $url) {
return $this->router->generate('homepage');
}
if (!Uri::isAbsolutePathReference(new Uri($url))) {
return $this->router->generate('homepage');
}
return $url;
}
@ -41,14 +49,14 @@ class Redirect
return $this->router->generate('homepage');
}
if (null !== $url) {
return $url;
}
if ('' === $fallback) {
if (null === $url) {
return $this->router->generate('homepage');
}
return $fallback;
if (!Uri::isAbsolutePathReference(new Uri($url))) {
return $this->router->generate('homepage');
}
return $url;
}
}

View File

@ -133,7 +133,7 @@ class RuleBasedTagger
private function fixEntry(Entry $entry)
{
$clonedEntry = clone $entry;
$clonedEntry->setReadingTime($entry->getReadingTime() / $entry->getUser()->getConfig()->getReadingSpeed() * 200);
$clonedEntry->setReadingTime($entry->getUserReadingTime());
return $clonedEntry;
}

View File

@ -37,6 +37,20 @@ class EntryRepository extends ServiceEntityRepository
;
}
/**
* Retrieves all entries count for a user.
*
* @param int $userId
*
* @return QueryBuilder
*/
public function getCountBuilderForAllByUser($userId)
{
return $this
->getQueryBuilderByUser($userId)
;
}
/**
* Retrieves unread entries for a user.
*
@ -52,6 +66,21 @@ class EntryRepository extends ServiceEntityRepository
;
}
/**
* Retrieves unread entries count for a user.
*
* @param int $userId
*
* @return QueryBuilder
*/
public function getCountBuilderForUnreadByUser($userId)
{
return $this
->getQueryBuilderByUser($userId)
->andWhere('e.isArchived = false')
;
}
/**
* Retrieves entries with the same domain.
*
@ -94,6 +123,21 @@ class EntryRepository extends ServiceEntityRepository
;
}
/**
* Retrieves read entries count for a user.
*
* @param int $userId
*
* @return QueryBuilder
*/
public function getCountBuilderForArchiveByUser($userId)
{
return $this
->getQueryBuilderByUser($userId)
->andWhere('e.isArchived = true')
;
}
/**
* Retrieves starred entries for a user.
*
@ -109,6 +153,21 @@ class EntryRepository extends ServiceEntityRepository
;
}
/**
* Retrieves starred entries count for a user.
*
* @param int $userId
*
* @return QueryBuilder
*/
public function getCountBuilderForStarredByUser($userId)
{
return $this
->getQueryBuilderByUser($userId)
->andWhere('e.isStarred = true')
;
}
/**
* Retrieves entries filtered with a search term for a user.
*
@ -207,14 +266,15 @@ class EntryRepository extends ServiceEntityRepository
* @param string $order
* @param int $since
* @param string $tags
* @param string $detail 'metadata' or 'full'. Include content field if 'full'
* @param string $detail 'metadata' or 'full'. Include content field if 'full'
* @param string $domainName
* @param bool $hasAnnotations
*
* @todo Breaking change: replace default detail=full by detail=metadata in a future version
*
* @return Pagerfanta
*/
public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'asc', $since = 0, $tags = '', $detail = 'full', $domainName = '')
public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'asc', $since = 0, $tags = '', $detail = 'full', $domainName = '', $hasAnnotations = null)
{
if (!\in_array(strtolower($detail), ['full', 'metadata'], true)) {
throw new \Exception('Detail "' . $detail . '" parameter is wrong, allowed: full or metadata');
@ -273,6 +333,16 @@ class EntryRepository extends ServiceEntityRepository
$qb->andWhere('e.domainName = :domainName')->setParameter('domainName', $domainName);
}
if (null !== $hasAnnotations) {
if ($hasAnnotations) {
$qb->leftJoin('e.annotations', 'a')
->andWhere('a.id IS NOT NULL');
} else {
$qb->leftJoin('e.annotations', 'a')
->andWhere('a.id IS NULL');
}
}
if (!\in_array(strtolower($order), ['asc', 'desc'], true)) {
throw new \Exception('Order "' . $order . '" parameter is wrong, allowed: asc or desc');
}
@ -563,6 +633,23 @@ class EntryRepository extends ServiceEntityRepository
return $qb->getQuery()->getArrayResult();
}
/**
* @param int $userId
*
* @return array
*/
public function findEmptyEntriesIdByUserId($userId = null)
{
$qb = $this->createQueryBuilder('e')
->select('e.id');
if (null !== $userId) {
$qb->where('e.user = :userid AND e.content IS NULL')->setParameter(':userid', $userId);
}
return $qb->getQuery()->getArrayResult();
}
/**
* Find all entries by url and owner.
*

View File

@ -123,48 +123,63 @@
</div>
<div id="set2" class="col s12">
<div class="row">
<div class="input-field col s12">
{{ 'config.form_feed.description'|trans }}
</div>
</div>
<div class="row">
<div class="col s12">
<h6 class="grey-text">{{ 'config.form_feed.token_label'|trans }}</h6>
<div>
{% if feed.token %}
{{ feed.token }}
{% else %}
<em>{{ 'config.form_feed.no_token'|trans }}</em>
{% endif %}
{% if feed.token %}
<form action="{{ path('generate_token') }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('generate-token') }}"/>
<button type="submit" class="btn-link">{{ 'config.form_feed.token_reset'|trans }}</button>
</form>
<form action="{{ path('revoke_token') }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('revoke-token') }}"/>
<button type="submit" class="btn-link">{{ 'config.form_feed.token_revoke'|trans }}</button>
</form>
{% else %}
<form action="{{ path('generate_token') }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('generate-token') }}"/>
<button type="submit" class="btn-link">{{ 'config.form_feed.token_create'|trans }}</button>
</form>
{% endif %}
</div>
</div>
</div>
{% if feed.token %}
<div class="row">
<div class="col s12">
<h6 class="grey-text">{{ 'config.form_feed.feed_links'|trans }}</h6>
<ul>
<li><a href="{{ path('unread_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.unread'|trans }}</a></li>
<li><a href="{{ path('starred_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.starred'|trans }}</a></li>
<li><a href="{{ path('archive_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.archive'|trans }}</a></li>
<li><a href="{{ path('all_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.all'|trans }}</a></li>
</ul>
</div>
</div>
{% endif %}
{{ form_start(form.feed) }}
{{ form_errors(form.feed) }}
<div class="row">
<div class="input-field col s12">
{{ 'config.form_feed.description'|trans }}
</div>
</div>
<div class="row">
<div class="col s12">
<h6 class="grey-text">{{ 'config.form_feed.token_label'|trans }}</h6>
<div>
{% if feed.token %}
{{ feed.token }}
{% else %}
<em>{{ 'config.form_feed.no_token'|trans }}</em>
{% endif %}
{% if feed.token %}
<a href="{{ path('generate_token') }}">{{ 'config.form_feed.token_reset'|trans }}</a>
<a href="{{ path('revoke_token') }}">{{ 'config.form_feed.token_revoke'|trans }}</a>
{% else %}
<a href="{{ path('generate_token') }}">{{ 'config.form_feed.token_create'|trans }}</a>
{% endif %}
</div>
</div>
</div>
{% if feed.token %}
<div class="row">
<div class="col s12">
<h6 class="grey-text">{{ 'config.form_feed.feed_links'|trans }}</h6>
<ul>
<li><a href="{{ path('unread_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.unread'|trans }}</a></li>
<li><a href="{{ path('starred_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.starred'|trans }}</a></li>
<li><a href="{{ path('archive_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.archive'|trans }}</a></li>
<li><a href="{{ path('all_feed', {'username': feed.username, 'token': feed.token}) }}">{{ 'config.form_feed.feed_link.all'|trans }}</a></li>
</ul>
</div>
</div>
{% endif %}
<div class="row">
<div class="input-field col s12">
{{ form_label(form.feed.feed_limit) }}
@ -209,38 +224,66 @@
{{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
<br/>
<br/>
<div class="row">
<h5>{{ 'config.otp.page_title'|trans }}</h5>
<p>{{ 'config.form_user.two_factor_description'|trans }}</p>
<table>
<thead>
<tr>
<th>{{ 'config.form_user.two_factor.table_method'|trans }}</th>
<th>{{ 'config.form_user.two_factor.table_state'|trans }}</th>
<th>{{ 'config.form_user.two_factor.table_action'|trans }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td>
<td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
<td><a href="{{ path('config_otp_email') }}" class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_email'|trans }}</a> {% if app.user.isEmailTwoFactor %}<a href="{{ path('disable_otp_email') }}" class="waves-effect waves-light btn red">Disable</a>{% endif %}</td>
</tr>
<tr>
<td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td>
<td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
<td><a href="{{ path('config_otp_app') }}" class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_app'|trans }}</a> {% if app.user.isGoogleTwoFactor %}<a href="{{ path('disable_otp_app') }}" class="waves-effect waves-light btn red">Disable</a>{% endif %}</td>
</tr>
</tbody>
</table>
</div>
{{ form_widget(form.user._token) }}
</form>
{{ form_end(form.user) }}
<br/>
<br/>
<div class="row">
<h5>{{ 'config.otp.page_title'|trans }}</h5>
<p>{{ 'config.form_user.two_factor_description'|trans }}</p>
<table>
<thead>
<tr>
<th>{{ 'config.form_user.two_factor.table_method'|trans }}</th>
<th>{{ 'config.form_user.two_factor.table_state'|trans }}</th>
<th>{{ 'config.form_user.two_factor.table_action'|trans }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td>
<td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
<td>
<form action="{{ path('config_otp_email') }}" method="post" name="config_otp_email">
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
<button class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}" type="submit">{{ 'config.form_user.two_factor.action_email'|trans }}</button>
</form>
{% if app.user.isEmailTwoFactor %}
<form action="{{ path('disable_otp_email') }}" method="post" name="disable_otp_email">
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
<button class="waves-effect waves-light btn red" type="submit">Disable</button>
</form>
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td>
<td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
<td>
<form action="{{ path('config_otp_app') }}" method="post" name="config_otp_app">
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
<button class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}" type="submit">{{ 'config.form_user.two_factor.action_app'|trans }}</button>
</form>
{% if app.user.isGoogleTwoFactor %}
<form action="{{ path('disable_otp_app') }}" method="post" name="disable_otp_app">
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
<button class="waves-effect waves-light btn red" type="submit">Disable</button>
</form>
{% endif %}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="set4" class="col s12">
@ -297,9 +340,13 @@
<a href="{{ path('edit_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="mode_edit_tagging_rule">
<i class="tool grey-text material-icons">mode_edit</i>
</a>
<a href="{{ path('delete_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="delete_tagging_rule">
<i class="tool grey-text material-icons">delete</i>
</a>
<form action="{{ path('delete_tagging_rule', {id: tagging_rule.id}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('delete-tagging-rule') }}"/>
<button type="submit" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="btn-link">
<i class="tool grey-text material-icons">delete</i>
</button>
</form>
</li>
{% endfor %}
</ul>
@ -477,9 +524,13 @@
<a href="{{ path('edit_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="mode_edit">
<i class="tool grey-text material-icons">mode_edit</i>
</a>
<a href="{{ path('delete_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="delete">
<i class="tool grey-text material-icons">delete</i>
</a>
<form action="{{ path('delete_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('delete-ignore-origin-rule') }}"/>
<button type="submit" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="btn-link">
<i class="tool grey-text material-icons">delete</i>
</button>
</form>
</li>
{% endfor %}
</ul>
@ -552,18 +603,34 @@
<div class="row">
<h5>{{ 'config.reset.title'|trans }}</h5>
<p>{{ 'config.reset.description'|trans }}</p>
<a href="{{ path('config_reset', {type: 'annotations'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
{{ 'config.reset.annotations'|trans }}
</a>
<a href="{{ path('config_reset', {type: 'tags'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
{{ 'config.reset.tags'|trans }}
</a>
<a href="{{ path('config_reset', {type: 'archived'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
{{ 'config.reset.archived'|trans }}
</a>
<a href="{{ path('config_reset', {type: 'entries'}) }}" onclick="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" class="waves-effect waves-light btn red">
{{ 'config.reset.entries'|trans }}
</a>
<p>
<form action="{{ path('config_reset', {type: 'annotations'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-annotations">
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.annotations'|trans }}</button>
</form>
</p>
<p>
<form action="{{ path('config_reset', {type: 'tags'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-tags">
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.tags'|trans }}</button>
</form>
</p>
<p>
<form action="{{ path('config_reset', {type: 'archived'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-archived">
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.archived'|trans }}</button>
</form>
</p>
<p>
<form action="{{ path('config_reset', {type: 'entries'}) }}" method="post" onsubmit="return confirm('{{ 'config.reset.confirm'|trans|escape('js') }}')" name="reset-entries">
<input type="hidden" name="token" value="{{ csrf_token('reset-area') }}" />
<button class="waves-effect waves-light btn red" type="submit">{{ 'config.reset.entries'|trans }}</button>
</form>
</p>
</div>
{% if enabled_users > 1 %}

View File

@ -40,18 +40,16 @@
{% endfor %}
<form class="form" action="{{ path("config_otp_app_check") }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('otp') }}" />
<div class="card-content">
<div class="row">
<div class="input-field col s12">
<label for="_auth_code">{{ "auth_code"|trans({}, 'SchebTwoFactorBundle') }}</label>
<input id="_auth_code" type="text" autocomplete="off" name="_auth_code" />
<input id="_auth_code" type="text" autocomplete="off" name="_auth_code" required="required" />
</div>
</div>
</div>
<div class="card-action">
<a href="{{ path('config_otp_app_cancel') }}" class="waves-effect waves-light grey btn">
{{ 'config.otp.app.cancel'|trans }}
</a>
<button class="btn waves-effect waves-light" type="submit" name="send">
{{ 'config.otp.app.enable'|trans }}
<i class="material-icons right">send</i>

View File

@ -2,11 +2,6 @@
{% block title %}{{ 'developer.howto.page_title'|trans }}{% endblock %}
{% block css %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/themes/prism-dark.min.css') }}">
{% endblock %}
{% block content %}
<div class="row">
<div class="col s12">
@ -18,7 +13,7 @@
<p>{{ 'developer.howto.description.paragraph_3'|trans({'%link%': path('developer_create_client')})|raw }}</p>
<p>{{ 'developer.howto.description.paragraph_4'|trans }}</p>
<p>
<pre><code class="language-bash">http POST https://app.wallabag.it/oauth/v2/token \
<pre><code class="language-bash">http POST {{ wallabag_url }}/oauth/v2/token \
grant_type=password \
client_id=12_5um6nz50ceg4088c0840wwc0kgg44g00kk84og044ggkscso0k \
client_secret=3qd12zpeaxes8cwg8c0404g888co4wo8kc4gcw0occww8cgw4k \
@ -47,7 +42,7 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
</p>
<p>{{ 'developer.howto.description.paragraph_6'|trans }}</p>
<p>
<pre><code class="language-bash">http GET https://app.wallabag.it/api/entries.json \
<pre><code class="language-bash">http GET {{ wallabag_url }}/api/entries.json \
"Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"</code></pre>
</p>
<p>{{ 'developer.howto.description.paragraph_7'|trans }}</p>
@ -58,6 +53,4 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
</div>
</div>
</div>
<script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/prism.min.js') }}"></script>
<script src="{{ asset('https://cdnjs.cloudflare.com/ajax/libs/prism/1.4.1/components/prism-bash.min.js') }}"></script>
{% endblock %}

View File

@ -57,9 +57,11 @@
<p>{{ 'developer.remove.warn_message_1'|trans({'%name%': client.name}) }}</p>
<p>{{ 'developer.remove.warn_message_2'|trans({'%name%': client.name}) }}</p>
<p>
<a class="waves-effect waves-light red btn" href="{{ path('developer_delete_client', {'id': client.id}) }}">{{ 'developer.remove.action'|trans({'%name%': client.name}) }}</a>
</p>
<form action="{{ path('developer_delete_client', {id: client.id}) }}" method="post" name="delete-client">
<input type="hidden" name="token" value="{{ csrf_token('delete-client') }}" />
<button class="waves-effect waves-light btn red" type="submit">{{ 'developer.remove.action'|trans({'%name%': client.name}) }}</button>
</form>
</div>
</li>
{% endfor %}

View File

@ -1,3 +1,3 @@
<div class="entry-checkbox">
<input type="checkbox" class="entry-checkbox-input" data-js="entry-checkbox" name="entry-checkbox[]" value="{{ entry.id }}" />
</div>
<label class="entry-checkbox">
<input type="checkbox" form="form_mass_action" class="entry-checkbox-input" data-js="entry-checkbox" name="entry-checkbox[]" value="{{ entry.id }}" />
</label>

View File

@ -7,18 +7,38 @@
</div>
</div>
{% set current_path = app.request.requesturi %}
<ul class="tools right">
<li>
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id}) }}" data-action="same_domain" data-entry-id="{{ entry.id }}"><i class="material-icons">language</i></a>
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id, redirect: current_path}) }}" data-action="same_domain" data-entry-id="{{ entry.id }}"><i class="material-icons">language</i></a>
</li>
<li>
<a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', {'id': entry.id}) }}" data-action="archived" data-entry-id="{{ entry.id }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a>
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.toogle_as_read'|trans }}">
<i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
</button>
</form>
</li>
<li>
<a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', {'id': entry.id}) }}" data-action="star" data-entry-id="{{ entry.id }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.toogle_as_star'|trans }}">
<i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i>
</button>
</form>
</li>
<li>
<a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" data-action-confirm="{{ 'entry.confirm.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', {'id': entry.id}) }}" data-action="delete" data-entry-id="{{ entry.id }}"><i class="material-icons">delete</i></a>
<form action="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('delete-entry') }}"/>
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')">
<i class="material-icons">delete</i>
</button>
</form>
</li>
</ul>
</div>

View File

@ -9,12 +9,33 @@
</div>
{% endif %}
{% include "@WallabagCore/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %}
{% set current_path = app.request.requesturi %}
<ul class="tools-list hide-on-small-only">
<li>
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id}) }}"><i class="material-icons">language</i></a>
<a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a>
<a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
<a title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" class="tool grey-text delete" href="{{ path('delete_entry', {'id': entry.id}) }}"><i class="material-icons">delete</i></a>
<a title="{{ 'entry.list.show_same_domain'|trans }}" class="tool grey-text" href="{{ path('same_domain', {'id': entry.id, redirect: current_path}) }}"><i class="material-icons">language</i></a>
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.toogle_as_read'|trans }}">
<i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
</button>
</form>
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.toogle_as_star'|trans }}">
<i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i>
</button>
</form>
<form action="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('delete-entry') }}"/>
<button type="submit" class="btn-link tool grey-text" title="{{ 'entry.list.delete'|trans }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')">
<i class="material-icons">delete</i>
</button>
</form>
</li>
</ul>
</div>

View File

@ -1,7 +1,7 @@
<div class="card entry-card{% if currentRoute in routes and entry.isArchived %} archived{% endif %}">
{% include "@WallabagCore/Entry/Card/_mass_checkbox.html.twig" with {'entry': entry} only %}
<div class="card-body">
<div class="{% if app.user.config.displayThumbnails %}card-image{% endif %} waves-effect waves-block waves-light">
{% include "@WallabagCore/Entry/Card/_mass_checkbox.html.twig" with {'entry': entry} only %}
<ul class="card-entry-labels">
{% for tag in entry.tags|slice(0, 3) %}
<li title="{{ tag.label }}"><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li>

View File

@ -1,7 +1,7 @@
{% set reading_time = entry.readingTime / app.user.config.readingSpeed * 200 %}
{% set reading_time = entry.userReadingTime %}
<i class="material-icons grey-text">timer</i>
{% if reading_time > 0 %}
<span>{{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': reading_time|round}) }}</span>
<span>{{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': reading_time}) }}</span>
{% else %}
<span>{{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}</span>
{% endif %}

View File

@ -4,9 +4,14 @@
<li class="chip">
<a class="chip-label" href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a>
{% if withRemove is defined and withRemove == true %}
<a class="chip-action" href="{{ path('remove_tag', {'entry': entryId, 'tag': tag.id}) }}" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')">
<i class="material-icons vertical-align-middle">delete</i>
</a>
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
<form action="{{ path('remove_tag', {'entry': entryId, 'tag': tag.id, redirect: current_path}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('remove-tag') }}"/>
<button type="submit" class="btn-link chip-action" onclick="return confirm('{{ 'entry.confirm.delete_tag'|trans|escape('js') }}')">
<i class="material-icons vertical-align-middle">delete</i>
</button>
</form>
{% endif %}
</li>
{% endfor %}

View File

@ -9,7 +9,7 @@
{% elseif current_route == 'search' %}
{{ 'entry.page_titles.filtered_search'|trans }} {{ filter }}
{% elseif current_route == 'tag_entries' %}
{{ 'entry.page_titles.filtered_tags'|trans }} {{ filter }}
{{ 'entry.page_titles.filtered_tags'|trans }} {{ tag.label }}
{% elseif current_route == 'untagged' %}
{{ 'entry.page_titles.untagged'|trans }}
{% elseif current_route == 'same_domain' %}

View File

@ -19,18 +19,27 @@
{% endblock %}
{% block content %}
{% set current_path = app.request.requesturi %}
{% set list_mode = app.user.config.listMode %}
{% set entries_with_archived_class_routes = ['tag_entries', 'search', 'all'] %}
{% set current_route = app.request.attributes.get('_route') %}
{% if current_route == 'homepage' %}
{% set current_route = 'unread' %}
{% endif %}
<form name="form_mass_action" action="{{ path('mass_action') }}" method="post">
<form id="form_mass_action" name="form_mass_action" action="{{ path('mass_action', {redirect: current_path}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('mass-action') }}"/>
</form>
<div class="results">
<div class="nb-results">
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
{{ 'entry.list.number_on_the_page'|trans({'%count%': entries.count}) }}
{% if entries.count > 0 %}
<a class="results-item" href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if list_mode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
<form action="{{ path('switch_view_mode', {redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('switch-view-mode') }}"/>
<button type="submit" class="btn-link results-item">
<i class="material-icons">{% if list_mode == 0 %}view_list{% else %}view_module{% endif %}</i>
</button>
</form>
{% endif %}
{% if entries.count > 0 %}
<label for="mass-action-inputs-displayed" class="mass-action-toggle results-item tooltipped" data-position="right" data-delay="50" data-tooltip="{{ 'entry.list.toggle_mass_action'|trans }}"><i class="material-icons">library_add_check</i></label>
@ -39,7 +48,13 @@
{% include "@WallabagCore/Entry/_feed_link.html.twig" %}
{% endif %}
</div>
{% if current_route == 'search' %}<div><a href="{{ path('tag_this_search', {'filter': searchTerm, 'currentRoute': app.request.get('currentRoute')}) }}" title="{{ 'entry.list.assign_search_tag'|trans }}">{{ 'entry.list.assign_search_tag'|trans }}</a></div>{% endif %}
{% if current_route == 'search' %}
<form action="{{ path('tag_this_search', {'filter': searchTerm, 'currentRoute': app.request.get('currentRoute'), redirect: current_path}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('tag-this-search') }}"/>
<button type="submit" class="btn-link" title="{{ 'entry.list.assign_search_tag'|trans }}">{{ 'entry.list.assign_search_tag'|trans }}</button>
</form>
{% endif %}
{% if entries.getNbPages > 1 %}
{{ pagerfanta(entries, 'default_wallabag') }}
{% endif %}
@ -49,17 +64,15 @@
<input id="mass-action-inputs-displayed" class="toggle-checkbox" type="checkbox" />
<div class="mass-action">
<div class="mass-action-group">
<input type="checkbox" class="entry-checkbox-input" data-toggle="[data-js='entry-checkbox']" data-js="checkboxes-toggle" />
<button class="mass-action-button btn cyan darken-1" type="submit" name="toggle-read" title="{{ 'entry.list.toogle_as_read'|trans }}"><i class="material-icons">done</i></button>
<button class="mass-action-button btn cyan darken-1" type="submit" name="toggle-star" title="{{ 'entry.list.toogle_as_star'|trans }}" ><i class="material-icons">star</i></button>
<button class="mass-action-button btn cyan darken-1" type="submit" name="delete" onclick="return confirm('{{ 'entry.confirm.delete_entries'|trans|escape('js') }}')" title="{{ 'entry.list.delete'|trans }}"><i class="material-icons">delete</i></button>
<label for="mass-action-tags-displayed" class="mass-action-button btn cyan darken-1" type="button" title="{{ 'entry.list.add_tags'|trans }}"><i class="material-icons">label</i></label>
<input type="checkbox" form="form_mass_action" class="entry-checkbox-input" data-toggle="[data-js='entry-checkbox']" data-js="checkboxes-toggle" />
<button class="mass-action-button btn cyan darken-1" type="submit" form="form_mass_action" name="toggle-read" title="{{ 'entry.list.toogle_as_read'|trans }}"><i class="material-icons">done</i></button>
<button class="mass-action-button btn cyan darken-1" type="submit" form="form_mass_action" name="toggle-star" title="{{ 'entry.list.toogle_as_star'|trans }}" ><i class="material-icons">star</i></button>
<button class="mass-action-button btn cyan darken-1" type="submit" form="form_mass_action" name="delete" onclick="return confirm('{{ 'entry.confirm.delete_entries'|trans|escape('js') }}')" title="{{ 'entry.list.delete'|trans }}"><i class="material-icons">delete</i></button>
</div>
<input id="mass-action-tags-displayed" class="toggle-checkbox" type="checkbox" />
<div class="mass-action-tags">
<input type="text" class="mass-action-tags-input" name="tags" placeholder="{{ 'entry.list.mass_action_tags_input_placeholder'|trans }}" />
<button class="btn cyan darken-1" type="submit" name="tag">{{ 'entry.list.add_tags'|trans }}</button>
<button class="btn cyan darken-1 mass-action-button mass-action-button--tags" type="submit" form="form_mass_action" name="tag" title="{{ 'entry.list.add_tags'|trans }}"><i class="material-icons">label</i></button>
<input type="text" form="form_mass_action" class="mass-action-tags-input" name="tags" placeholder="{{ 'entry.list.mass_action_tags_input_placeholder'|trans }}" />
</div>
</div>
@ -78,7 +91,6 @@
{% endfor %}
</ol>
{% endif %}
</form>
{% if entries.getNbPages > 1 %}
<div class="results">
@ -118,9 +130,9 @@
<h4 class="center">{{ 'entry.filters.title'|trans }}</h4>
<div class="row">
{% if current_route != 'untagged' and nbEntriesUntagged != 0 %}
{% if current_route != 'untagged' %}
<div class="col s12 center-align">
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }} ({{ nbEntriesUntagged }})</a>
<a href="{{ path('untagged') }}">{{ 'tag.list.see_untagged_entries'|trans }}</a>
</div>
{% endif %}

View File

@ -4,6 +4,8 @@
{% block body_class %}entry{% endblock %}
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
{% block menu %}
<div class="progress">
<div class="determinate"></div>
@ -24,14 +26,22 @@
</ul>
<ul class="right">
<li>
<a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_read'|trans }}" href="{{ path('archive_entry', {'id': entry.id}) }}" id="markAsRead">
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
</a>
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
<button type="submit" class="waves-effect" title="{{ 'entry.view.left_menu.set_as_read'|trans }}">
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
</button>
</form>
</li>
<li>
<a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', {'id': entry.id}) }}" id="setFav">
<i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
</a>
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
<button type="submit" class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}">
<i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
</button>
</form>
</li>
</ul>
</div>
@ -54,10 +64,14 @@
</li>
<li class="bold">
<a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" href="{{ path('reload_entry', {'id': entry.id}) }}" id="reload">
<i class="material-icons small">refresh</i>
<span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span>
</a>
<form action="{{ path('reload_entry', {'id': entry.id}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('reload-entry') }}"/>
<button type="submit" class="waves-effect collapsible-header" onclick="return confirm('{{ 'entry.confirm.reload'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}">
<i class="material-icons small">refresh</i>
<span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span>
</button>
</form>
<div class="collapsible-body"></div>
</li>
@ -67,25 +81,37 @@
{% endif %}
<li class="bold hide-on-med-and-down">
<a class="waves-effect collapsible-header markasread" title="{{ mark_as_read_label|trans }}" href="{{ path('archive_entry', {'id': entry.id}) }}" id="markAsRead">
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
<span>{{ mark_as_read_label|trans }}</span>
</a>
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
<button type="submit" class="waves-effect collapsible-header markasread" title="{{ mark_as_read_label|trans }}">
<i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
<span>{{ mark_as_read_label|trans }}</span>
</button>
</form>
<div class="collapsible-body"></div>
</li>
<li class="bold hide-on-med-and-down">
<a class="waves-effect collapsible-header favorite" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', {'id': entry.id}) }}" id="setFav">
<i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
<span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
</a>
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
<button type="submit" class="waves-effect collapsible-header favorite" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}">
<i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
<span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
</button>
</form>
<div class="collapsible-body"></div>
</li>
<li class="bold border-bottom">
<a class="waves-effect collapsible-header delete" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.delete'|trans }}" href="{{ path('delete_entry', {'id': entry.id}) }}">
<i class="material-icons small">delete</i>
<span>{{ 'entry.view.left_menu.delete'|trans }}</span>
</a>
<form action="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('delete-entry') }}"/>
<button type="submit" class="waves-effect collapsible-header delete" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" title="{{ 'entry.view.left_menu.delete'|trans }}">
<i class="material-icons small">delete</i>
<span>{{ 'entry.view.left_menu.delete'|trans }}</span>
</button>
</form>
<div class="collapsible-body"></div>
</li>
@ -133,14 +159,22 @@
<ul>
{% if craue_setting('share_public') %}
<li>
<a href="{{ path('share', {'id': entry.id}) }}" target="_blank" title="{{ 'entry.view.left_menu.public_link'|trans }}" class="tool icon-eye">
<span>{{ 'entry.view.left_menu.public_link'|trans }}</span>
</a>
<form action="{{ path('share', {'id': entry.id}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('share-entry') }}"/>
<button type="submit" formtarget="_blank" class="btn-link tool icon-eye" title="{{ 'entry.view.left_menu.public_link'|trans }}">
<span>{{ 'entry.view.left_menu.public_link'|trans }}</span>
</button>
</form>
</li>
<li>
<a href="{{ path('delete_share', {'id': entry.id}) }}" title="{{ 'entry.view.left_menu.delete_public_link'|trans }}" class="tool icon-no-eye">
<span>{{ 'entry.view.left_menu.delete_public_link'|trans }}</span>
</a>
<form action="{{ path('delete_share', {'id': entry.id}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('delete-share') }}"/>
<button type="submit" class="btn-link tool icon-no-eye" title="{{ 'entry.view.left_menu.delete_public_link'|trans }}">
<span>{{ 'entry.view.left_menu.delete_public_link'|trans }}</span>
</button>
</form>
</li>
{% endif %}
{% if craue_setting('share_twitter') %}
@ -269,7 +303,7 @@
{% if entry.annotations|length %}
<li>
<i class="material-icons grey-text">comment</i>
{{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations|length) }}
{{ 'entry.view.annotations_on_the_entry'|trans({'%count%': entry.annotations|length}) }}
</li>
{% endif %}
{% if entry.originUrl is not empty %}
@ -298,9 +332,33 @@
<i class="material-icons">menu</i>
</a>
<ul>
<li><a class="btn-floating" href="{{ path('archive_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i></a></li>
<li><a class="btn-floating" href="{{ path('star_entry', {'id': entry.id}) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i></a></li>
<li><a class="btn-floating" href="{{ path('delete_entry', {'id': entry.id}) }}" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')"><i class="material-icons">delete</i></a></li>
<li>
<form action="{{ path('archive_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('archive-entry') }}"/>
<button type="submit" class="btn-floating">
<i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %}</i>
</button>
</form>
</li>
<li>
<form action="{{ path('star_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('star-entry') }}"/>
<button type="submit" class="btn-floating">
<i class="material-icons">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
</button>
</form>
</li>
<li>
<form action="{{ path('delete_entry', {'id': entry.id, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('delete-entry') }}"/>
<button type="submit" class="btn-floating" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')">
<i class="material-icons">delete</i>
</button>
</form>
</li>
</ul>
</div>
</div>

View File

@ -102,7 +102,7 @@
<ul>
<li><a href="https://github.com/wallabag/wallabag/issues/">{{ 'quickstart.support.github'|trans }}</a></li>
<li><a href="mailto:hello@wallabag.org">{{ 'quickstart.support.email'|trans }}</a></li>
<li><a href="https://gitter.im/wallabag/wallabag">{{ 'quickstart.support.gitter'|trans }}</a></li>
<li><a href="https://matrix.to/#/#wallabag:matrix.org">{{ 'quickstart.support.matrix'|trans }}</a></li>
</ul>
</div>
</div>

View File

@ -1,4 +1,4 @@
<form name="tag" method="post" action="{{ path('new_tag', {'entry': entry.id}) }}">
<form class="tags-add-form" name="tag" method="post" action="{{ path('new_tag', {'entry': entry.id}) }}">
{% if form_errors(form) %}
<span class="black-text">{{ form_errors(form) }}</span>
{% endif %}
@ -9,6 +9,6 @@
{{ form_widget(form.label, {'attr': {'autocomplete': 'off'}}) }}
{{ form_widget(form.add, {'attr': {'class': 'btn waves-effect waves-light hide-on-large-only'}}) }}
{{ form_widget(form.add, {'attr': {'class': 'btn waves-effect waves-light tags-add-form-submit'}}) }}
{{ form_widget(form._token) }}
</form>

View File

@ -3,8 +3,10 @@
{% block title %}{{ 'tag.page_title'|trans }}{% endblock %}
{% block content %}
{% set current_path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
<div class="results clearfix">
{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}
{{ 'tag.list.number_on_the_page'|trans({'%count%': tags|length}) }}
</div>
<div class="row">
@ -18,7 +20,7 @@
{{ tag.label }}&nbsp;({{ tag.nbEntries }})
</a>
{% if renameForms is defined and renameForms[tag.id] is defined %}
<form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug}) }}" method="POST">
<form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug, redirect: current_path}) }}" method="POST">
{{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }}
{{ form_rest(renameForms[tag.id]) }}
</form>
@ -26,9 +28,13 @@
<i class="material-icons">mode_edit</i>
</a>
{% endif %}
<a id="delete-{{ tag.slug }}" href="{{ path('tag_delete', {'slug': tag.slug}) }}" class="card-tag-icon card-tag-delete" onclick="return confirm('{{ 'tag.confirm.delete'|trans({'%name%': tag.label})|escape('js') }}')">
<i class="material-icons">delete</i>
</a>
<form action="{{ path('tag_delete', {'slug': tag.slug, redirect: current_path}) }}" method="post" class="inline-block">
<input type="hidden" name="token" value="{{ csrf_token('tag-delete') }}"/>
<button type="submit" class="btn-link card-tag-icon card-tag-delete" onclick="return confirm('{{ 'tag.confirm.delete'|trans({'%name%': tag.label})|escape('js') }}')">
<i class="material-icons">delete</i>
</button>
</form>
{% if app.user.config.feedToken %}
<a rel="alternate" type="application/atom+xml" href="{{ path('tag_feed', {'username': app.user.username, 'token': app.user.config.feedToken, 'slug': tag.slug}) }}" class="card-tag-icon"><i class="material-icons">rss_feed</i></a>
{% endif %}

View File

@ -168,7 +168,7 @@
<div class="container">
<div class="row">
<div class="col m12 l8">
<p class="footer-text" title="{{ display_stats()|raw|striptags }}">
<p class="footer-text">
{{ display_stats() }}
</p>
</div>

View File

@ -4,6 +4,8 @@ namespace Wallabag\CoreBundle\Tools;
class Utils
{
public const DEFAULT_WORDS_PER_MINUTE = 200;
/**
* Generate a token used for Feeds.
*
@ -28,6 +30,6 @@ class Utils
*/
public static function getReadingTime($text)
{
return floor(\count(preg_split('~([^\p{L}\p{N}\']+|(\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul}){1,2})~u', strip_tags($text))) / 200);
return floor(\count(preg_split('~([^\p{L}\p{N}\']+|(\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul}){1,2})~u', strip_tags($text))) / self::DEFAULT_WORDS_PER_MINUTE);
}
}

View File

@ -8,6 +8,7 @@ use Twig\Extension\AbstractExtension;
use Twig\Extension\GlobalsInterface;
use Twig\TwigFilter;
use Twig\TwigFunction;
use Wallabag\AnnotationBundle\Repository\AnnotationRepository;
use Wallabag\CoreBundle\Repository\EntryRepository;
use Wallabag\CoreBundle\Repository\TagRepository;
use Wallabag\UserBundle\Entity\User;
@ -16,19 +17,21 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
{
private $tokenStorage;
private $entryRepository;
private $annotationRepository;
private $tagRepository;
private $lifeTime;
private $translator;
private $rootDir;
private $projectDir;
public function __construct(EntryRepository $entryRepository, TagRepository $tagRepository, TokenStorageInterface $tokenStorage, $lifeTime, TranslatorInterface $translator, string $rootDir)
public function __construct(EntryRepository $entryRepository, AnnotationRepository $annotationRepository, TagRepository $tagRepository, TokenStorageInterface $tokenStorage, $lifeTime, TranslatorInterface $translator, string $projectDir)
{
$this->entryRepository = $entryRepository;
$this->annotationRepository = $annotationRepository;
$this->tagRepository = $tagRepository;
$this->tokenStorage = $tokenStorage;
$this->lifeTime = $lifeTime;
$this->translator = $translator;
$this->rootDir = $rootDir;
$this->projectDir = $projectDir;
}
public function getGlobals(): array
@ -88,35 +91,29 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
switch ($type) {
case 'starred':
$qb = $this->entryRepository->getBuilderForStarredByUser($user->getId());
$qb = $this->entryRepository->getCountBuilderForStarredByUser($user->getId())->select('COUNT(e.id)');
break;
case 'archive':
$qb = $this->entryRepository->getBuilderForArchiveByUser($user->getId());
$qb = $this->entryRepository->getCountBuilderForArchiveByUser($user->getId())->select('COUNT(e.id)');
break;
case 'unread':
$qb = $this->entryRepository->getBuilderForUnreadByUser($user->getId());
$qb = $this->entryRepository->getCountBuilderForUnreadByUser($user->getId())->select('COUNT(e.id)');
break;
case 'annotated':
$qb = $this->entryRepository->getBuilderForAnnotationsByUser($user->getId());
$qb = $this->annotationRepository->getCountBuilderByUser($user->getId())->select('COUNT(DISTINCT e.entry)');
break;
case 'all':
$qb = $this->entryRepository->getBuilderForAllByUser($user->getId());
$qb = $this->entryRepository->getCountBuilderForAllByUser($user->getId())->select('COUNT(e.id)');
break;
default:
throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
}
// THANKS to PostgreSQL we CAN'T make a DEAD SIMPLE count(e.id)
// ERROR: column "e0_.id" must appear in the GROUP BY clause or be used in an aggregate function
$query = $qb
->select('e.id')
->groupBy('e.id')
->getQuery();
$query = $qb->getQuery();
$query->useQueryCache(true);
$query->enableResultCache($this->lifeTime);
return \count($query->getArrayResult());
return $query->getSingleScalarResult();
}
/**
@ -148,15 +145,14 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
return 0;
}
$query = $this->entryRepository->getBuilderForArchiveByUser($user->getId())
->select('e.id')
->groupBy('e.id')
$query = $this->entryRepository->getCountBuilderForArchiveByUser($user->getId())
->select('COUNT(e.id)')
->getQuery();
$query->useQueryCache(true);
$query->enableResultCache($this->lifeTime);
$nbArchives = \count($query->getArrayResult());
$nbArchives = $query->getSingleScalarResult();
$interval = $user->getCreatedAt()->diff(new \DateTime('now'));
$nbDays = (int) $interval->format('%a') ?: 1;
@ -174,7 +170,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
public function assetFileExists($name)
{
return file_exists(realpath($this->rootDir . '/../web/' . $name));
return file_exists(realpath($this->projectDir . '/web/' . $name));
}
public function themeClass()

View File

@ -13,10 +13,15 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Wallabag\ImportBundle\Import\ChromeImport;
use Wallabag\ImportBundle\Import\DeliciousImport;
use Wallabag\ImportBundle\Import\ElcuratorImport;
use Wallabag\ImportBundle\Import\FirefoxImport;
use Wallabag\ImportBundle\Import\InstapaperImport;
use Wallabag\ImportBundle\Import\OmnivoreImport;
use Wallabag\ImportBundle\Import\PinboardImport;
use Wallabag\ImportBundle\Import\PocketCsvImport;
use Wallabag\ImportBundle\Import\PocketHtmlImport;
use Wallabag\ImportBundle\Import\ReadabilityImport;
use Wallabag\ImportBundle\Import\ShaarliImport;
use Wallabag\ImportBundle\Import\WallabagV1Import;
use Wallabag\ImportBundle\Import\WallabagV2Import;
use Wallabag\UserBundle\Entity\User;
@ -34,10 +39,31 @@ class ImportCommand extends Command
private InstapaperImport $instapaperImport;
private PinboardImport $pinboardImport;
private DeliciousImport $deliciousImport;
private OmnivoreImport $omnivoreImport;
private WallabagV1Import $wallabagV1Import;
private ElcuratorImport $elcuratorImport;
private ShaarliImport $shaarliImport;
private PocketHtmlImport $pocketHtmlImport;
private PocketCsvImport $pocketCsvImport;
public function __construct(EntityManagerInterface $entityManager, TokenStorageInterface $tokenStorage, UserRepository $userRepository, WallabagV2Import $wallabagV2Import, FirefoxImport $firefoxImport, ChromeImport $chromeImport, ReadabilityImport $readabilityImport, InstapaperImport $instapaperImport, PinboardImport $pinboardImport, DeliciousImport $deliciousImport, WallabagV1Import $wallabagV1Import)
{
public function __construct(
EntityManagerInterface $entityManager,
TokenStorageInterface $tokenStorage,
UserRepository $userRepository,
WallabagV2Import $wallabagV2Import,
FirefoxImport $firefoxImport,
ChromeImport $chromeImport,
ReadabilityImport $readabilityImport,
InstapaperImport $instapaperImport,
PinboardImport $pinboardImport,
DeliciousImport $deliciousImport,
WallabagV1Import $wallabagV1Import,
ElcuratorImport $elcuratorImport,
OmnivoreImport $omnivoreImport,
ShaarliImport $shaarliImport,
PocketHtmlImport $pocketHtmlImport,
PocketCsvImport $pocketCsvImport
) {
$this->entityManager = $entityManager;
$this->tokenStorage = $tokenStorage;
$this->userRepository = $userRepository;
@ -48,7 +74,12 @@ class ImportCommand extends Command
$this->instapaperImport = $instapaperImport;
$this->pinboardImport = $pinboardImport;
$this->deliciousImport = $deliciousImport;
$this->omnivoreImport = $omnivoreImport;
$this->wallabagV1Import = $wallabagV1Import;
$this->elcuratorImport = $elcuratorImport;
$this->shaarliImport = $shaarliImport;
$this->pocketHtmlImport = $pocketHtmlImport;
$this->pocketCsvImport = $pocketCsvImport;
parent::__construct();
}
@ -60,7 +91,7 @@ class ImportCommand extends Command
->setDescription('Import entries from a JSON export')
->addArgument('username', InputArgument::REQUIRED, 'User to populate')
->addArgument('filepath', InputArgument::REQUIRED, 'Path to the JSON file')
->addOption('importer', null, InputOption::VALUE_OPTIONAL, 'The importer to use: v1, v2, instapaper, pinboard, delicious, readability, firefox or chrome', 'v1')
->addOption('importer', null, InputOption::VALUE_OPTIONAL, 'The importer to use: v1, v2, instapaper, pinboard, delicious, readability, firefox, chrome, elcurator, shaarli, pocket or pocket_csv', 'v1')
->addOption('markAsRead', null, InputOption::VALUE_OPTIONAL, 'Mark all entries as read', false)
->addOption('useUserId', null, InputOption::VALUE_NONE, 'Use user id instead of username to find account')
->addOption('disableContentUpdate', null, InputOption::VALUE_NONE, 'Disable fetching updated content from URL')
@ -120,6 +151,21 @@ class ImportCommand extends Command
case 'delicious':
$import = $this->deliciousImport;
break;
case 'omnivore':
$import = $this->omnivoreImport;
break;
case 'elcurator':
$import = $this->elcuratorImport;
break;
case 'shaarli':
$import = $this->shaarliImport;
break;
case 'pocket':
$import = $this->pocketHtmlImport;
break;
case 'pocket_csv':
$import = $this->pocketCsvImport;
break;
default:
$import = $this->wallabagV1Import;
}

Some files were not shown because too many files have changed in this diff Show More