Commit graph

420 commits

Author SHA1 Message Date
ArthurHoaro
b38a1b0209 Use PSR-3 logger for login attempts
Fixes #1122
2020-10-20 11:47:07 +02:00
ArthurHoaro
21e72da9ee Asynchronous retrieval of bookmark's thumbnails
This feature is based general.enable_async_metadata setting and works with existing metadata.js file.
The script is compatible with any template:
   - the thumbnail div bloc must have  attribute
   - the bookmark bloc must have  attribute with the bookmark ID as value

Fixes #1564
2020-10-20 10:15:18 +02:00
ArthurHoaro
9b3c1270bc
Merge pull request #1567 from ArthurHoaro/feature/async-title-retrieval 2020-10-20 10:14:28 +02:00
ArthurHoaro
f1a148ab92 add search highlight unit tests 2020-10-16 20:31:49 +02:00
ArthurHoaro
4b3aca6623 Strict types: fix an issue in daily where the date could be an int 2020-10-16 12:04:46 +02:00
ArthurHoaro
5334090be0 Improve metadata retrieval (performances and accuracy)
- Use dedicated function to download headers to avoid apply multiple regexps on headers
  - Also try to extract title from meta tags
2020-10-15 11:36:56 +02:00
ArthurHoaro
4cf3564d28 Add a setting to retrieve bookmark metadata asynchrounously
- There is a new standalone script (metadata.js) which requests
    a new controller to get bookmark metadata and fill the form async
  - This feature is enabled with the new setting: general.enable_async_metadata
    (enabled by default)
  - general.retrieve_description is now enabled by default
  - A small rotating loader animation has a been added to bookmark inputs
    when metadata is being retrieved (default template)
  - Custom JS htmlentities has been removed and  mathiasbynens/he
    library is used instead

Fixes #1563
2020-10-15 09:08:46 +02:00
ArthurHoaro
efb7d21b52 Add strict types for bookmarks management
Parameters typing and using strict types overall increase the codebase
quality by enforcing the a given parameter will have the expected type.

It also removes the need to unnecessary unit tests checking methods
behavior with invalid input.
2020-10-13 13:50:11 +02:00
ArthurHoaro
fd1ddad98d Add mutex on datastore I/O operations
To make sure that there is no concurrent operation on the datastore file.

Fixes #1132
2020-10-13 12:38:19 +02:00
ArthurHoaro
458b6b9918
Merge pull request #1540 from ArthurHoaro/fix/metadata-regexes
Improve regex to extract HTML metadata (title, description, etc.)
2020-10-13 12:26:55 +02:00
ArthurHoaro
543b16b4f4
Merge pull request #1525 from ArthurHoaro/feature/rest-api-bookmark-dates
REST API: allow override of creation and update dates
2020-10-13 12:26:01 +02:00
ArthurHoaro
8fabcd0224 Add Markdown Extra formatter
Library: [Parsedown Extra](https://github.com/erusev/parsedown-extra)

Also sort dependencies alphabetically.

Fixes #1169
2020-10-13 12:20:34 +02:00
ArthurHoaro
7b18876361
Merge pull request #1575 from ArthurHoaro/feature/php8 2020-10-03 12:59:16 +02:00
ArthurHoaro
ee07b7283f
Merge pull request #1574 from stoeps13/hosting-fix 2020-10-03 12:59:01 +02:00
ArthurHoaro
255b2264a1 Revert unrelated changes and add unit tests 2020-09-30 15:57:57 +02:00
ArthurHoaro
80a3efe116 Fix a bug preventing to edit bookmark with ID #0 2020-09-30 15:31:34 +02:00
ArthurHoaro
c3fca560b6
Merge pull request #1569 from ArthurHoaro/fix/bad-encoding
Fix warning if the encoding retrieved from external headers is invalid
2020-09-30 11:35:57 +02:00
ArthurHoaro
1ea09a1b8b Fix warning if the encoding retrieved from external headers is invalid
Also fixed the regex to support this failing header: charset="utf-8"\r\n"
2020-09-30 11:11:19 +02:00
ArthurHoaro
d246e2c512 Use assertRegExp polyfill instead of regexMatches 2020-09-29 18:57:25 +02:00
ArthurHoaro
f447edb73b Fix missing @expectedException convertion 2020-09-29 18:57:25 +02:00
ArthurHoaro
ab58f25420 Compatibility with PHP 8 2020-09-29 18:57:22 +02:00
ArthurHoaro
a5a9cf23ac Compatibility with PHPUnit 9 2020-09-29 18:57:20 +02:00
ArthurHoaro
b1baca99f2 Convert legacy PHPUnit @expected* to new ->expect*
Converted automatically using https://github.com/ArthurHoaro/convert-legacy-phpunit-expect
2020-09-27 14:09:55 +02:00
ArthurHoaro
8f60e1206e Comply with PHPUnit V8: setup/teardown functions must return void 2020-09-26 15:08:39 +02:00
ArthurHoaro
585fc700fa
Merge pull request #1560 from ArthurHoaro/fix/redirect-wrong-path
Fix invalid redirection using the path of an external domain
2020-09-25 10:59:51 +02:00
ArthurHoaro
85b972baf6
Merge pull request #1558 from ArthurHoaro/fix/plugins-base-path
Fix plugin base path in core plugins
2020-09-25 10:59:40 +02:00
ArthurHoaro
abe033be85 Fix invalid redirection using the path of an external domain
Fixes #1554
2020-09-22 15:37:26 +02:00
ArthurHoaro
98e7a59ca2
Merge pull request #1539 from ArthurHoaro/feature/manual-root-url 2020-09-22 14:08:54 +02:00
ArthurHoaro
76fe68d924 Fix plugin base path in core plugins
Also fix note check in archiveorg plugin, and regression on vintage template.
Documentation regarding relative path has been added.

Fixes #1548
2020-09-22 13:50:19 +02:00
ArthurHoaro
0d930454a2
Merge pull request #1553 from ArthurHoaro/fix/404-page
Properly handle 404 errors
2020-09-12 21:41:58 +02:00
ArthurHoaro
4af591ff3c
Merge pull request #1551 from ArthurHoaro/fix/plugin-save-metadata
Plugins: do not save metadata along plugin parameters
2020-09-12 21:41:24 +02:00
ArthurHoaro
b93cfeba7b Fix subfolder configuration in unit tests 2020-09-12 21:39:01 +02:00
ArthurHoaro
650a5f09cb Add manual configuration for root URL
This new setting under 'general.root_url' allows to override automatic discovery of Shaarli instance's URL.

Fixes #1339
2020-09-12 21:39:01 +02:00
ArthurHoaro
4ff703e369 Plugins: do not save metadata along plugin parameters
Also prevent the token to be saved.

Fixes #1550
2020-09-12 13:29:34 +02:00
ArthurHoaro
d52ab0b1e9 Properly handle 404 errors
Use 404 template instead of default Slim error page if the route is not found.

Fixes #827
2020-09-12 12:42:19 +02:00
ArthurHoaro
6128ab6a55
Merge pull request #1552 from ArthurHoaro/feature/better-initializer 2020-09-12 12:14:18 +02:00
ArthurHoaro
da7acb9830 Improve default bookmarks after install
Used @nodiscc suggestion in #1148 (slightly edited).
It provides a description of what Shaarli does, Markdown rendering demo, and a thumbnail link.

Fixes #1148
2020-09-10 16:29:17 +02:00
ArthurHoaro
e2dff28b44
Merge pull request #1547 from ArthurHoaro/fix/daily-visibility
Fix visibility issue on daily page
2020-09-06 14:16:08 +02:00
ArthurHoaro
27ddfec3c3 Fix visibility issue on daily page
This filter (links by day) didn't apply any visibility parameter.

Fixes #1543
2020-09-06 14:11:02 +02:00
ArthurHoaro
2cd0509b50 Improve regex to extract HTML metadata (title, description, etc.)
Also added a bunch of tests to cover more use cases.

Fixes #1375
2020-09-03 17:46:26 +02:00
ArthurHoaro
46d3f8162b
Merge pull request #1537 from ArthurHoaro/fix/back-compatible-targets 2020-09-03 14:57:24 +02:00
ArthurHoaro
0386a84d82 Fix feed target in UT 2020-09-03 10:18:04 +02:00
ArthurHoaro
ce7918386a Improve backward compatibility for LegacyRouter
LegacyRouter is no longer used for routing, only in existing plugins to match the _PAGE_ parameter.
So we change a few of its values there, to match the new ones defined in TemplatePage.

@see discussion in shaarli/Shaarli#1537
2020-09-03 10:09:36 +02:00
ArthurHoaro
865f0a0e01
Merge pull request #1523 from ArthurHoaro/fix/default-colors-generation
Default colors plugin: generate CSS file during initialization
2020-09-03 08:48:51 +02:00
ArthurHoaro
9e6371a6fd
Merge pull request #1520 from ArthurHoaro/fix/jp-language 2020-09-03 08:46:47 +02:00
ArthurHoaro
2835ac7cbe
Merge pull request #1524 from ArthurHoaro/fix/rss-sticky
Fixed: Pinned bookmarks are displayed first in ATOM/RSS feeds
2020-09-03 08:45:12 +02:00
ArthurHoaro
d95624add4
Merge pull request #1534 from ArthurHoaro/fix/legacy-route-post 2020-09-03 08:35:05 +02:00
ArthurHoaro
11aa4a7a29 Support redirection of legacy route 'do=configure' 2020-09-01 10:40:35 +02:00
ArthurHoaro
9e2d47e519 Fix legacy redirection when Shaarli instance is under a subfolder 2020-09-01 10:40:18 +02:00
ArthurHoaro
aca995e09c Fix support for legacy route login redirection
Makes sure that the user is properly redirected to the bookmark form after login, even with legacy routes
2020-09-01 10:12:54 +02:00