From af9c09e440dedce043c6fcbf1a03593b9f647917 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 29 Mar 2020 16:04:38 +0200 Subject: [PATCH 01/16] Add composer.json branch alias for Pico 3.0 --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 260467a..02b45aa 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,8 @@ }, "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "2.1.x-dev", + "dev-pico-3.0": "3.0.x-dev" } } } From 6c746fabb6cd3b6c1b0fae3242ba3de065a6e337 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Fri, 10 Apr 2020 23:14:33 +0200 Subject: [PATCH 02/16] Fix DummyPlugin declaring API version 3 --- plugins/DummyPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/DummyPlugin.php b/plugins/DummyPlugin.php index 415103b..10d39b3 100644 --- a/plugins/DummyPlugin.php +++ b/plugins/DummyPlugin.php @@ -28,7 +28,7 @@ class DummyPlugin extends AbstractPicoPlugin * * @var int */ - const API_VERSION = 2; + const API_VERSION = 3; /** * This plugin is disabled by default From 0ddde859e8e7c857f70f52f3c5ae2e81d5041e65 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Fri, 10 Apr 2020 23:17:01 +0200 Subject: [PATCH 03/16] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96784d8..a44f9a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,13 @@ Pico Changelog `PicoDeprecated`'s changelog. Please note that BC-breaking changes are only possible with a new major version. +### Version 2.1.2 +Released: 2020-04-10 + +``` +* [Fixed] Fix DummyPlugin declaring API version 3 +``` + ### Version 2.1.1 Released: 2019-12-31 From b892d6bb116aa50118ea7f8600bb437a5b3a3558 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Fri, 10 Apr 2020 23:17:45 +0200 Subject: [PATCH 04/16] Update Pico::VERSION and Pico::VERSION_ID --- lib/Pico.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Pico.php b/lib/Pico.php index e19cbb3..efb5b33 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -49,14 +49,14 @@ class Pico * * @var string */ - const VERSION = '2.1.1'; + const VERSION = '2.1.2'; /** * Pico version ID * * @var int */ - const VERSION_ID = 20101; + const VERSION_ID = 20102; /** * Pico API version From b2df86054646aac86c6eea6dc103413596bfc514 Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Sun, 14 Jun 2020 12:57:36 +0200 Subject: [PATCH 06/16] Add option to set a locale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As mentioned in https://www.php.net/manual/en/function.basename.php both basename() and dirname() are locale aware. An incorrect locale can cause the page tree to behave in strange ways. For example the structure /über-uns |-index.md |-impressum.md could lead to the page impressum not being a child of über-uns. --- config/config.yml.template | 1 + lib/Pico.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/config/config.yml.template b/config/config.yml.template index 159585b..5500ccb 100644 --- a/config/config.yml.template +++ b/config/config.yml.template @@ -7,6 +7,7 @@ base_url: ~ # Pico will try to guess its base URL, if th rewrite_url: ~ # A boolean (true or false) indicating whether URL rewriting is forced debug: ~ # Set this to true to enable Pico's debug mode timezone: ~ # Your PHP installation might require you to manually specify a timezone +locale: ~ # Your PHP installation might require you to manually specify a locale to use ## # Theme diff --git a/lib/Pico.php b/lib/Pico.php index efb5b33..071e66f 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -936,6 +936,7 @@ class Pico 'rewrite_url' => null, 'debug' => null, 'timezone' => null, + 'locale' => null, 'theme' => 'default', 'theme_config' => null, 'theme_meta' => null, @@ -974,6 +975,10 @@ class Pico } date_default_timezone_set($this->config['timezone']); + if ($this->config['locale'] !== null) { + setlocale(LC_ALL, $this->config['locale']); + } + if (!$this->config['plugins_url']) { $this->config['plugins_url'] = $this->getUrlFromPath($this->getPluginsDir()); } else { From 1345d6ac82909da119d99ec1ddb3bc3b5fe4f485 Mon Sep 17 00:00:00 2001 From: Dimitri Merejkowsky Date: Mon, 29 Jun 2020 21:37:24 +0200 Subject: [PATCH 07/16] More inclusive README Replace 'you guys' by something more gender neutral. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9b9fbc1..bca6f45 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Git is a very powerful distributed version-control system - and it can be used t ### I'm a developer -So, you're one of these amazing folks making all of this possible? We love you guys! As a developer we recommend you to clone [Pico's Git repository][PicoGit] as well as the Git repositories of [Pico's default theme][PicoThemeGit] and the [`PicoDeprecated` plugin][PicoDeprecatedGit]. You can set up your workspace using [Pico's Composer starter project][PicoComposerGit] and include all of Pico's components using local packages. +So, you're one of these amazing people making all of this possible? We love you folks! As a developer we recommend you to clone [Pico's Git repository][PicoGit] as well as the Git repositories of [Pico's default theme][PicoThemeGit] and the [`PicoDeprecated` plugin][PicoDeprecatedGit]. You can set up your workspace using [Pico's Composer starter project][PicoComposerGit] and include all of Pico's components using local packages. Using Pico's Git repositories is different from using one of the installation methods elucidated above. It gives you the current development version of Pico, what is likely *unstable* and *not ready for production use*! @@ -198,7 +198,7 @@ Contributing You want to contribute to Pico? We really appreciate that! You can help make Pico better by [contributing code][PullRequests] or [reporting issues][Issues], but please take note of our [contribution guidelines][ContributionGuidelines]. In general you can contribute in three different areas: -1. Plugins & Themes: You're a plugin developer or theme designer? We love you guys! You can find tons of information about how to develop plugins and themes at http://picocms.org/development/. If you have created a plugin or theme, please add it to our [Wiki][], either on the [plugins][WikiPlugins] or [themes][WikiThemes] page. You may also [Submit][] it to our website, where it'll be displayed on the official [plugin][OfficialPlugins] or [theme][OfficialThemes] pages! +1. Plugins & Themes: You're a plugin developer or theme designer? We love you folks! You can find tons of information about how to develop plugins and themes at http://picocms.org/development/. If you have created a plugin or theme, please add it to our [Wiki][], either on the [plugins][WikiPlugins] or [themes][WikiThemes] page. You may also [Submit][] it to our website, where it'll be displayed on the official [plugin][OfficialPlugins] or [theme][OfficialThemes] pages! 2. Documentation: We always appreciate people improving our documentation. You can either improve the [inline user docs][EditInlineDocs] or the more extensive [user docs on our website][EditUserDocs]. You can also improve the [docs for plugin and theme developers][EditDevDocs]. Simply fork our website's Git repository from https://github.com/picocms/picocms.github.io, change the Markdown files and open a [pull request][PullRequestsWebsite]. From 649feed2f6c1a28c3ed492c8fdae0182dbc7c487 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Fri, 10 Jul 2020 18:20:59 +0200 Subject: [PATCH 08/16] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a44f9a4..2676f33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ Pico Changelog `PicoDeprecated`'s changelog. Please note that BC-breaking changes are only possible with a new major version. +### Version 2.1.3 +Released: 2020-07-10 + +``` +* [New] Add `locale` option to `config/config.yml` +* [Changed] Improve Pico docs +``` + ### Version 2.1.2 Released: 2020-04-10 From 590d467347bce5f23d06068b93370bfaa24d356e Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Fri, 10 Jul 2020 18:51:32 +0200 Subject: [PATCH 09/16] Update Pico::VERSION and Pico::VERSION_ID --- lib/Pico.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Pico.php b/lib/Pico.php index 071e66f..ae53e68 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -49,14 +49,14 @@ class Pico * * @var string */ - const VERSION = '2.1.2'; + const VERSION = '2.1.3'; /** * Pico version ID * * @var int */ - const VERSION_ID = 20102; + const VERSION_ID = 20103; /** * Pico API version From 4be1f6ae90e66c6df23cd6b61911b277df4886fa Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Wed, 9 Sep 2020 17:52:11 +0200 Subject: [PATCH 11/16] Try to proberly encode formatted date strings returned by strftime() Fixes #560 --- composer.json | 1 + lib/Pico.php | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 02b45aa..b9ff27c 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ }, "require": { "php": ">=5.3.6", + "ext-mbstring": "*", "twig/twig": "^1.36", "symfony/yaml" : "^2.8", "erusev/parsedown": "1.8.0-beta-7", diff --git a/lib/Pico.php b/lib/Pico.php index ae53e68..f6384f9 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -1518,8 +1518,17 @@ class Pico } if (empty($meta['date_formatted'])) { - $dateFormat = $this->getConfig('date_format'); - $meta['date_formatted'] = $meta['time'] ? utf8_encode(strftime($dateFormat, $meta['time'])) : ''; + if ($meta['time']) { + $encodingList = mb_detect_order(); + if ($encodingList === array('ASCII', 'UTF-8')) { + $encodingList[] = 'Windows-1252'; + } + + $rawFormattedDate = strftime($this->getConfig('date_format'), $meta['time']); + $meta['date_formatted'] = mb_convert_encoding($rawFormattedDate, 'UTF-8', $encodingList); + } else { + $meta['date_formatted'] = ''; + } } } else { // guarantee array key existance From 1916dc5645bf71d7a6f68f4e46f478b0581370d6 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sat, 29 Aug 2020 16:07:10 +0200 Subject: [PATCH 12/16] Silence PHP notices in upstream Parsedown Parsedown is a still unresolved issue in whole, this at least ensures that we don't fill up logfiles with useless errors... --- lib/Pico.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Pico.php b/lib/Pico.php index f6384f9..26dfb59 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -1673,7 +1673,7 @@ class Pico public function parseFileContent($markdown, $singleLine = false) { $markdownParser = $this->getParsedown(); - return !$singleLine ? $markdownParser->text($markdown) : $markdownParser->line($markdown); + return !$singleLine ? @$markdownParser->text($markdown) : @$markdownParser->line($markdown); } /** From e4741d0fde8b64bd1f93bbee493f71fdbd4105f3 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sat, 29 Aug 2020 16:14:52 +0200 Subject: [PATCH 13/16] Update CHANGELOG.md --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2676f33..bf84f7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,15 @@ Pico Changelog `PicoDeprecated`'s changelog. Please note that BC-breaking changes are only possible with a new major version. +### Version 2.1.4 +Released: 2020-08-29 + +``` +* [Changed] Silence PHP errors in Parsedown +* [Fixed] #560: Improve charset guessing for formatted date strings using + `strftime()` (Pico always uses UTF-8, but `strftime()` might not) +``` + ### Version 2.1.3 Released: 2020-07-10 From b95cfe0a0ef5f504dbff76e810cf99db5dcfcc75 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sat, 29 Aug 2020 16:15:37 +0200 Subject: [PATCH 14/16] Update Pico::VERSION and Pico::VERSION_ID --- lib/Pico.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Pico.php b/lib/Pico.php index 26dfb59..af68379 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -49,14 +49,14 @@ class Pico * * @var string */ - const VERSION = '2.1.3'; + const VERSION = '2.1.4'; /** * Pico version ID * * @var int */ - const VERSION_ID = 20103; + const VERSION_ID = 20104; /** * Pico API version From 221625efacb726235ed86ad110472539826a608d Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Wed, 11 Nov 2020 16:10:46 +0100 Subject: [PATCH 16/16] CONTRIBUTING.md: Rename 'type: Question' label to 'type: Support' --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d37588..4eafb00 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -192,7 +192,7 @@ Issues and pull requests labeled with `info: Feedback Needed` indicate that feed - The `type: Release` label is used in the exact same way as `type: Feature` and indicates the primary pull request of a new Pico release (please refer to the *Branching* and *Build & Release process* sections above). -- The `type: Notice`, `type: Question` and `type: Discussion` labels are used to indicate "fyi" issues, issues opened by users or developers asking questions, and issues with disucssions about arbitrary topics related to Pico. They are neither combined with `pri` labels, nor with `status` labels. +- The `type: Notice`, `type: Support` and `type: Discussion` labels are used to indicate "fyi" issues, support-related issues (e.g. issues opened by users or developers asking questions), and issues with disucssions about arbitrary topics related to Pico. They are neither combined with `pri` labels, nor with `status` labels. - The `type: Duplicate` label is used when there is already another issue or pull request related to this problem or feature request. Issues labeled with `type: Duplicate` are immediately closed. @@ -200,7 +200,7 @@ Issues and pull requests labeled with `info: Feedback Needed` indicate that feed The `status: Deferred` label might get added to any open issue or pull request to indicate that it is still unresolved and will be resolved later. This is also true for the `info: Pinned` label: It indicates a important issue or pull request that remains open on purpose. -After resolving a issue, we usually keep it open for about a week to give users some more time for feedback and further questions. This is especially true for issues with the `type: Notice`, `type: Question`, `type: Discussion` and `type: Invalid` labels. After 7 days with no interaction, [Probot](https://probot.github.io/)'s [Stale](https://github.com/apps/stale) bot adds the `info: Stale` label to the issue to ask the participants whether the issue has been resolved. If no more activity occurs, the issue will be automatically closed by Stale bot 2 days later. +After resolving a issue, we usually keep it open for about a week to give users some more time for feedback and further questions. This is especially true for issues with the `type: Notice`, `type: Support`, `type: Discussion` and `type: Invalid` labels. After 7 days with no interaction, [Probot](https://probot.github.io/)'s [Stale](https://github.com/apps/stale) bot adds the `info: Stale` label to the issue to ask the participants whether the issue has been resolved. If no more activity occurs, the issue will be automatically closed by Stale bot 2 days later. Issues and pull requests labeled with `info: Information Needed` indicate that we have asked one of the participants for further information and didn't receive any feedback yet. It is usually added after Stale bot adds the `info: Stale` label to give the participants some more days to give the necessary information.