Commit graph

544 commits

Author SHA1 Message Date
Keith Carangelo c6f27b1ade Fixed issues after running make code_sniffer 2021-09-08 15:46:51 -04:00
Keith Carangelo a7d43caccb Added support for OR (~) and optional AND (+) operators for tag searches. 2021-09-08 15:26:58 -04:00
YFdyh000 142370f0a1 Add Chinese (Simplified) translation 2021-08-10 07:23:42 +08:00
ArthurHoaro af764dfd4e
Merge pull request #1731 from ArthurHoaro/fix/search-highlight-table
Search highlight: do not use special characters for tokens
2021-04-05 11:10:43 +02:00
ArthurHoaro b2a43bc861 Search highlight: do not use special characters for tokens
It messes with Markdown syntax (tables in this case).

Fixes #1729
2021-04-05 09:15:25 +02:00
Ajabep 2ea2c99dcb
Fix a bug
When we try to access the atom feed and have no bookmarks, it raised the following exception :

```
Call to a member function reorder() on array /webroot/application/bookmark/BookmarkFileService.php:143
#0 /webroot/application/feed/FeedBuilder.php(106): Shaarli\Bookmark\BookmarkFileService->search(Array, 'public', false, false, true)
#1 /webroot/application/front/controller/visitor/FeedController.php(47): Shaarli\Feed\FeedBuilder->buildData('atom', Array)
#2 /webroot/application/front/controller/visitor/FeedController.php(20): Shaarli\Front\Controller\Visitor\FeedController->processRequest('atom', Object(Slim\Http\Request), Object(Slim\Http\Response))
#3 [internal function]: Shaarli\Front\Controller\Visitor\FeedController->atom(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#4 /webroot/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#5 /webroot/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#6 /webroot/application/front/ShaarliMiddleware.php(55): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#7 [internal function]: Shaarli\Front\ShaarliMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#8 /webroot/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Array, Array)
#9 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#10 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#11 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#12 /webroot/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#13 /webroot/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
#14 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#15 /webroot/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#16 /webroot/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#17 /webroot/index.php(177): Slim\App->run(true)
#18 {main}
```
2021-04-02 21:14:09 +02:00
ArthurHoaro bcba6bd353 New plugin hook: ability to add custom filters to Shaarli search engine
A new plugin hook has been added: hook_test_filter_search_entry
This hook allows to filter out bookmark with custom plugin code when a search is performed.

Related to #143
2021-02-04 11:02:50 +01:00
ArthurHoaro 8997ae6c8e
Merge pull request #1697 from ArthurHoaro/feature/pagination
Handle pagination through BookmarkService
2021-02-04 10:57:44 +01:00
ArthurHoaro 11edc143b4
Merge pull request #1696 from ArthurHoaro/fix/search-highlight-url 2021-02-04 10:57:12 +01:00
ArthurHoaro a1cd7a3b2f ShaarliParsedown: add PHPDoc/comments 2021-02-04 10:53:23 +01:00
ArthurHoaro 9b8c0a4560 Handle pagination through BookmarkService
Handle all search results through SearchResult object.
This is a required step toward implementing a BookmarkService based on SQL database.

Related to #953
2021-01-20 15:01:29 +01:00
ArthurHoaro 055d97f9a9
Merge pull request #1695 from ArthurHoaro/fix/ut-curl 2021-01-20 11:31:35 +01:00
ArthurHoaro 9ef8555ad2 Support search highlights when matching URL content
DefaultFormatter:
  - format 'a' tag content and not href attribute
  - format hashtags properly
Markdown(Extra)Formatter:
  - Extend Parsedown to format highlight properly: https://github.com/erusev/parsedown/wiki/Tutorial:-Create-Extensions

Fixes #1681
2021-01-19 17:49:19 +01:00
ArthurHoaro dafd3f081a format_date: include timezone in IntlDateFormatter object
@see https://www.php.net/manual/en/intldateformatter.format.php

> If a DateTime or an IntlCalendar object is passed, its timezone is not considered. The object will be formatted using the formaterʼs configured timezone. If one wants to use the timezone of the object to be formatted, IntlDateFormatter::setTimeZone() must be called before with the objectʼs timezone.
2021-01-19 15:03:28 +01:00
ArthurHoaro 6b76ce6f62 curl usage: support HTTP/2 response code header 2021-01-19 15:03:18 +01:00
ArthurHoaro 93175b6e9d Fix: bulk add - delete existing link
Do not send redirect response in bookmark delete controller if the request comes from bulk creation page.

Fixes #1683
2021-01-19 12:54:34 +01:00
ArthurHoaro ccd1862d5f Inject current template name in templates
Use either legacy key _PAGE_ or new 'template' one.

Related to https://github.com/kalvn/Shaarli-Material/issues/118
2021-01-19 10:34:11 +01:00
ArthurHoaro 0640c1a6db API: POST/PUT Link - properly parse tags string
Even though the documentation specify that tags should be passed as an array, tags string is actually allowed. So this adds a proper parsing with configured separator.

Related to #1651
2020-12-29 13:01:04 +01:00
ArthurHoaro fe58bdcd9e
Merge pull request #1664 from ArthurHoaro/fix/metadata-sync
Fix: synchronous metadata retrieval is failing in strict mode
2020-12-29 11:44:10 +01:00
ArthurHoaro 8ed5fbef8f
Merge pull request #1665 from ArthurHoaro/fix/metadata-regexes-2
Fix metadata extract regex (2)
2020-12-29 11:43:39 +01:00
ArthurHoaro f00600a283 Daily RSS Cache: invalidate cache base on the date
Currently the cache is only invalidated when the datastore changes, while it should rely on selected period of time.

Fixes #1659
2020-12-17 15:48:03 +01:00
ArthurHoaro 88a8e284b2 Fix metadata extract regex (2)
Reference: https://stackoverflow.com/questions/8055727/negating-a-backreference-in-regular-expressions

Fixes #1656
2020-12-17 13:56:24 +01:00
ArthurHoaro ab4c170672
Merge pull request #1644 from ArthurHoaro/fix/daily-rss
Daily RSS - Remove relative description (today, yesterday)
2020-12-16 16:04:53 +01:00
ArthurHoaro bd11879018
Merge pull request #1645 from ArthurHoaro/feature/plugin-register-route
Plugin system: allow plugins to provide custom routes
2020-12-16 16:04:15 +01:00
ArthurHoaro 6a3a78d023 Fix: synchronous metadata retrieval is failing in strict mode
Metadata can now only be string or null.

Fixes #1653
2020-12-16 14:04:32 +01:00
ArthurHoaro 8a6b7e96b7 Fix: soft fail if the mutex is not working
And display the error in server admin page

Fixes #1650
2020-11-24 13:39:35 +01:00
ArthurHoaro a6e9c08499 Plugin system: allow plugins to provide custom routes
- each route will be prefixed by `/plugin/<plugin_name>`
  - add a new template for plugins rendering
  - add a live example in the demo_plugin

Check out the "Plugin System" documentation for more detail.

Related to #143
2020-11-15 12:41:43 +01:00
ArthurHoaro 2883c6d0a7 Daily RSS - Remove relative description (today, yesterday)
It is not useful for the RSS feed, as every new entry will be 'yesterday', and it requires an update the next day.
2020-11-15 12:05:08 +01:00
prog-it 150f2a0f24 Add russian language selection 2020-11-14 07:45:10 +05:00
ArthurHoaro 302662797c
Merge pull request #1635 from ArthurHoaro/feature/phpcs 2020-11-10 10:46:04 +01:00
ArthurHoaro 80c8889bfe Server admin: do not retrieve latest version without update_check
If the setting 'updates.check_updates' is disabled, do not retrieve the latest version on server administration page.

Additionally, updated default values for

  - updates.check_updates from false to true
  - updates.check_updates_branch from stable to latest
2020-11-09 14:42:30 +01:00
ArthurHoaro b99e00f7cd Manually fix remaining PHPCS errors 2020-11-09 10:56:49 +01:00
ArthurHoaro 53054b2bf6 Apply PHP Code Beautifier on source code for linter automatic fixes 2020-11-09 10:56:24 +01:00
ArthurHoaro d9d71b10c3
Merge pull request #1621 from ArthurHoaro/feature/tag-separators 2020-11-08 14:07:33 +01:00
ArthurHoaro c51d65238b
Merge pull request #1629 from ArthurHoaro/fix/demo-vimeo
Replace vimeo link in demo bookmarks due to IP ban on the demo instance
2020-11-08 14:06:45 +01:00
ArthurHoaro 00d3dd91ef Fix an issue truncating extracted metadata content
Previous regex forced the selection to stop at either the first single or double quote found, regardless of the opening quote. Using '\1', we're sure to wait for the proper quote before stopping the capture.
2020-11-08 13:54:39 +01:00
ArthurHoaro 9952de2fe0 Replace vimeo link in demo bookmarks due to IP ban on the demo instance
Fixes #1148
2020-11-08 11:58:17 +01:00
ArthurHoaro cfdd209440 Display error details even with dev.debug set to false
It makes more sense to display the error even if it's unexpected.
Only for logged in users.

Fixes #1606
2020-11-05 19:55:17 +01:00
ArthurHoaro b3bd8c3e8d Feature: support any tag separator
So it allows to have multiple words tags.

Breaking change: commas ',' are no longer a default separator.

Fixes #594
2020-11-05 17:54:42 +01:00
ArthurHoaro 8bbf57a2d0
Merge pull request #1620 from ArthurHoaro/feature/no-auto-link
Default formatter: add a setting to disable auto-linkification
2020-11-05 16:47:17 +01:00
ArthurHoaro 330ac859fb Fix: redirect to referrer after bookmark deletion
Except if the referer points to a permalink (which has been deleted).

Fixes #1622
2020-11-05 16:14:27 +01:00
ArthurHoaro 740b32b520 Default formatter: add a setting to disable auto-linkification
+ update documentation
  + single parameter for both URL and hashtags

Fixes #1094
2020-11-03 12:43:35 +01:00
ArthurHoaro dff039092d
Merge pull request #1616 from dimtion/fix-api-redirect
API postLink: change relative path to absolute path
2020-10-29 16:03:07 +01:00
Loïc Carr b37ca79072 postLink: change relative path to absolute path 2020-10-28 20:08:18 -07:00
ArthurHoaro 14c9370b4f
Merge pull request #1615 from ArthurHoaro/hotfix/save-redirect
Remove unnecessary escape of referer
2020-10-28 14:18:25 +01:00
ArthurHoaro 114a43b20e Remove unnecessary escape of referer
Fixes #1611
2020-10-28 14:13:50 +01:00
ArthurHoaro d3f6d52525 Fix compatiliby issue on login with PHP 7.1
session_set_cookie_params does not return any value in PHP 7.1
2020-10-28 14:02:08 +01:00
ArthurHoaro 156061d445 Raise 404 error instead of 500 if permalink access is denied 2020-10-28 13:16:18 +01:00
ArthurHoaro 34c8f558e5 Bulk creation: ignore blank lines 2020-10-27 20:11:30 +01:00
ArthurHoaro c609944cb9 Bulk creation: improve performances using memoization
Reduced additional processing time per links from ~40ms to ~5ms
2020-10-27 20:11:30 +01:00