Commit graph

69 commits

Author SHA1 Message Date
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
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
972daa4513 Default colors plugin: generate CSS file during initialization
Current behaviour only generate the custom CSS file when the plugin settings are saved, which can be annoying if the file is deleted but the settings are set.
Most common use case is Docker deployment, because the plugin directory is not mounted as a volume.
2020-08-29 09:38:30 +02:00
ArthurHoaro
7e3dc0ba98 Better handling of plugin incompatibility
If a PHP is raised while executing plugin hook, Shaarli will display an error instead of rendering the error page (or just ending in fatal error for default hooks).
Also added phpErrorHandler which is handled differently that regular errorHandler by Slim.:
2020-08-27 12:04:36 +02:00
ArthurHoaro
9fbc42294e New basePath: fix officiel plugin paths and vintage template 2020-07-26 14:43:10 +02:00
ArthurHoaro
1a8ac737e5 Process main page (linklist) through Slim controller
Including a bunch of improvements on the container,
and helper used across new controllers.
2020-07-23 21:19:21 +02:00
ArthurHoaro
03340c18ea Slim router: handle add tag route 2020-07-23 21:19:21 +02:00
ArthurHoaro
e26e2060f5 Add and update unit test for the new system (Bookmark + Service)
See #1307
2020-01-18 09:56:32 +01:00
ArthurHoaro
354fb98cc9 Markdown plugin: fix RSS feed direct link reverse
The plugin was only reversing permalinks and failed with setting rss_permalinks set to false
2019-08-15 12:56:32 +02:00
ArthurHoaro
b550735054 Default colors plugin - Add unit tests 2019-07-20 09:32:52 +02:00
ArthurHoaro
520d29578c Remove the redirector setting
Fixes #1239
2019-02-09 13:55:11 +01:00
VirtualTam
dea72c711f Optimize and cleanup imports
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2019-01-13 00:04:42 +01:00
VirtualTam
9585441734 namespacing: add plugin tests to \Shaarli\Plugin\[...]
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2019-01-12 23:11:19 +01:00
VirtualTam
e185038834 namespacing: \Shaarli\Plugin\PluginManager
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2019-01-12 23:11:19 +01:00
VirtualTam
a932f486f2 namespacing: \Shaarli\Router
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2019-01-12 23:11:19 +01:00
VirtualTam
fe3713d2e5 namespacing: move LinkUtils along \Shaarli\Bookmark classes
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2019-01-12 22:47:48 +01:00
VirtualTam
f24896b237 namespacing: \Shaarli\Bookmark\LinkDB
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2019-01-12 22:47:48 +01:00
VirtualTam
067c2dd8f5 lint: apply phpcbf to tests/
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2018-12-02 22:39:16 +01:00
ArthurHoaro
e95247d41d
Merge pull request #1205 from ArthurHoaro/feature/opengraph
Add OpenGraph meta tags on permalink page
2018-10-06 13:31:07 +02:00
ArthurHoaro
fa8100c088
Merge pull request #1212 from ArthurHoaro/hotfix/hashtag-md-escape
Fix hashtags with markdown escape enabled
2018-10-06 13:28:51 +02:00
ArthurHoaro
0e54e1059f Isso plugin: add an icon in linklist if enabled
Fixes #1075
2018-08-14 13:39:31 +02:00
ArthurHoaro
cb7940e2de Fix hashtags with markdown escape enabled
They're now transformed to markdown syntax links before processing them through Parsedown.

Fixes #1210
2018-08-14 12:26:51 +02:00
ArthurHoaro
a120fb2977 Add OpenGraph meta tags on permalink page
Includes:
  - og:title
  - og:type -> article
  - og:image -> if there is a thumbnail
  - og:url -> permalink
  - og:description -> first 300 chars of raw description
  - article:published_time
  - article:modified_time
  - article:tag -> one OG meta tag for each shaare tag

Fixes #258
2018-08-13 10:55:48 +02:00
ArthurHoaro
dd6794cff8 Fix feed permalink rendering with markdown escape set to true
Fixes #1134
2018-05-19 12:55:43 +02:00
ArthurHoaro
c5ee13181e Update parsedown to its latest version instead of fixed 1.6 2018-03-31 13:00:13 +02:00
ArthurHoaro
d2d4f993e1 PSR: use elseif instead of else if
See https://www.php-fig.org/psr/psr-2/\#51-if-elseif-else
2018-02-28 22:34:40 +01:00
kalvn
50142efd1b Executes daily hooks before creating columns. 2018-02-01 13:16:58 +01:00
ArthurHoaro
86ceea054f Add a whitelist of protocols for URLs
- for Shaare
 - for markdown description links and images

Not whitelisted protocols will be replaced by `http://`
2017-05-25 14:58:34 +02:00
ArthurHoaro
8e33d0e767 Remove readityourself plugin
Fixes #818
2017-04-01 12:32:43 +02:00
VirtualTam
3c66e56435 application: introduce the Shaarli\Config namespace
Namespaces have been introduced with the REST API, and should be generalized
to the whole codebase to manage object scope and benefit from autoloading.

See:
- https://secure.php.net/manual/en/language.namespaces.php
- http://www.php-fig.org/psr/psr-4/

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2017-03-04 17:07:52 +01:00
ArthurHoaro
e037610115 Add markdown_escape setting
This setting allows to escape HTML in markdown rendering or not.
The goal behind it is to avoid XSS issue in shared instances.

More info:

  * the setting is set to true by default
  * it is set to false for anyone who already have the plugin enabled
  (avoid breaking existing entries)
  * improve the HTML sanitization when the setting is set to false - but don't consider it XSS proof
  * mention the setting in the plugin README
2017-02-28 19:16:54 +01:00
ArthurHoaro
053673cb71 Remove CSS call for addlink toolbar plugin
Fixes #724
2017-01-15 17:50:16 +01:00
VirtualTam
93b1fe54fb Cleanup: explicit method visibility
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
2017-01-05 19:52:04 +01:00
ArthurHoaro
db90dfcbbc Move PubSubHubbub code as a default plugin 2016-12-20 11:41:24 +01:00
ArthurHoaro
d592daea83 Add a persistent 'shorturl' key to all links
All existing link will keep their permalinks.
New links will have smallhash generated with date+id.

The purpose of this is to avoid collision between links due to their creation date.
2016-12-12 03:03:12 +01:00
ArthurHoaro
c3dfd89959 Unit Test for the new ID system 2016-12-12 03:03:12 +01:00
ArthurHoaro
266e3fe5c8 Markdown: fixes feed rendering with nomarkdown tag
* make sure we match exactly `nomarkdown` tag
 * pass the whole link data to stripNoMarkdownTag() to:
   * strip the noMD tag in taglist (array)
   * strip the tag in tags (string)

Fixes #689

tmp
2016-11-22 10:26:03 +01:00
ArthurHoaro
c5941f316a Fix an issue with links not being reversed in code blocks
Fixes #672

+ Markdown to HTML unit test
2016-10-22 11:13:48 +02:00
ArthurHoaro
bf26e7ebcb Isso comments plugin
Use Isso client to let visitors comments on permalinks
2016-10-17 09:23:14 +02:00
ArthurHoaro
7fde6de121 New init function for plugins, supports errors reporting
All plugins can optionally add an init function named `pluginname_init()` which is called when the plugin is loaded.

This function is aware of the config, and can return initialization errors, which are displayed in the header template.

Note that the previous error system hack no longer work.
2016-10-14 13:22:58 +02:00
Teromene
5e148f8a52 Archive.org plugin: do not propose archival of private notes
Fixes #637
2016-10-13 16:37:43 +01:00
ArthurHoaro
15170b5164 Parse plugin parameters description with the PluginManager
Plugin parameter can contain a description in their meta file under the key:

    parameter.<param_name>="<description>"
2016-08-02 11:12:01 +02:00
Arthur
649af5b501 Merge pull request #570 from ArthurHoaro/config-manager
Introduce a configuration manager
2016-07-09 07:19:48 +02:00
ArthurHoaro
51def0d849 PluginManager no longer uses singleton pattern 2016-06-11 09:30:56 +02:00
ArthurHoaro
eeea1c3daa Use the configuration manager for wallabag and readityourself plugin 2016-06-11 09:30:56 +02:00
ArthurHoaro
8c4e60186d The tag is no longer private
A private tag is never loaded for visitor, making this feature useless.
2016-05-30 18:51:00 +02:00
ArthurHoaro
3ce20d9e84 Markdown: Add the 'meta-tag' .nomarkdown which prevent a shaare from being parsed with markdown
Also add the tag in tag list in edit_link, so it will appear on autocompletion.
2016-03-21 18:46:34 +01:00
ArthurHoaro
2925687e1e Markdown: don't escape content + sanitize sensible tags
Instead of trying to fix broken content for Markdown parsing, parse it unescaped, then sanatize sensible tags such as scripts, etc.
2016-02-19 19:37:13 +01:00
Arthur
53603f5823 Merge pull request #388 from ArthurHoaro/pluginadmin
Fixes #378 - Plugin administration UI.
2016-01-31 19:00:13 +01:00
Arthur
893338f0d4 Merge pull request #379 from ArthurHoaro/plugin-markdown
PLUGIN Markdown
2016-01-31 18:57:29 +01:00