From be558ccac9223dcc24ec4c04612e5a479714d686 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 17 May 2019 11:10:15 -0600 Subject: [PATCH 1/3] fixes #2507 --- CHANGELOG.md | 1 + system/src/Grav/Common/Utils.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8f9208e..e08fec6aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ 1. [](#bugfix) * Force question to install demo content in theme update [#2493](https://github.com/getgrav/grav/issues/2493) * Fixed GPM errors from blueprints not being logged [#2505](https://github.com/getgrav/grav/issues/2505) + * Don't error when IP is invalid [#2507](https://github.com/getgrav/grav/issues/2507) # v1.6.9 ## 05/09/2019 diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index ad9b289f3..9b0992f99 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -1494,12 +1494,11 @@ abstract class Utils * @param int $prefix * * @return string - * @throws \InvalidArgumentException if provided an invalid IP */ public static function getSubnet($ip, $prefix = 64) { if (!filter_var($ip, FILTER_VALIDATE_IP)) { - throw new \InvalidArgumentException('Invalid IP: ' . $ip); + return $ip; } // Packed representation of IP From 7e1d3b260e65ee010cc2c954b269d15dbc753ec8 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 17 May 2019 23:01:54 -0700 Subject: [PATCH 2/3] Fixed regression with `bin/plugin` not listing the plugins available (1c725c0) --- CHANGELOG.md | 3 ++- bin/plugin | 25 ++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e08fec6aa..43149a09b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ * Force question to install demo content in theme update [#2493](https://github.com/getgrav/grav/issues/2493) * Fixed GPM errors from blueprints not being logged [#2505](https://github.com/getgrav/grav/issues/2505) * Don't error when IP is invalid [#2507](https://github.com/getgrav/grav/issues/2507) - + * Fixed regression with `bin/plugin` not listing the plugins available (1c725c0) + # v1.6.9 ## 05/09/2019 diff --git a/bin/plugin b/bin/plugin index 6f8466d81..3c431e379 100755 --- a/bin/plugin +++ b/bin/plugin @@ -79,19 +79,6 @@ $output = new ConsoleOutput(); $output->getFormatter()->setStyle('red', new OutputFormatterStyle('red', null, array('bold'))); $output->getFormatter()->setStyle('white', new OutputFormatterStyle('white', null, array('bold'))); -if (is_null($plugin)) { - $output->writeln(''); - $output->writeln("$name plugin not found"); - die; -} - -if (!$plugin->enabled) { - $output->writeln(''); - $output->writeln("$name not enabled"); - die; -} - - if (!$name) { $output->writeln(''); $output->writeln('Usage:'); @@ -123,6 +110,18 @@ if (!$name) { } exit; +} else { + if (is_null($plugin)) { + $output->writeln(''); + $output->writeln("$name plugin not found"); + die; + } + + if (!$plugin->enabled) { + $output->writeln(''); + $output->writeln("$name not enabled"); + die; + } } if ($plugin === null) { From 30e96aa4ff2c6cafbcde7db2d28f7249f3f0b7a8 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sat, 18 May 2019 11:12:58 -0600 Subject: [PATCH 3/3] address deprecated message --- system/src/Grav/Common/Page/Medium/ParsedownHtmlTrait.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Page/Medium/ParsedownHtmlTrait.php b/system/src/Grav/Common/Page/Medium/ParsedownHtmlTrait.php index 365cf1d66..c6d75bc77 100644 --- a/system/src/Grav/Common/Page/Medium/ParsedownHtmlTrait.php +++ b/system/src/Grav/Common/Page/Medium/ParsedownHtmlTrait.php @@ -10,6 +10,7 @@ namespace Grav\Common\Page\Medium; use Grav\Common\Markdown\Parsedown; +use Grav\Common\Page\Markdown\Excerpts; trait ParsedownHtmlTrait { @@ -33,7 +34,7 @@ trait ParsedownHtmlTrait $element = $this->parsedownElement($title, $alt, $class, $id, $reset); if (!$this->parsedown) { - $this->parsedown = new Parsedown(); + $this->parsedown = new Parsedown(new Excerpts()); } return $this->parsedown->elementToHtml($element);