Remove double URL encode when processing params in links - #860

This commit is contained in:
Andy Miller
2016-05-30 17:14:21 -06:00
parent 7fc2f20f1b
commit 4de9c94bd5
3 changed files with 4 additions and 1 deletions

View File

@@ -11,6 +11,7 @@
* Detect if user really meant to extend parent blueprint, not another one (fixes old page type blueprints)
* Fixed a bug in `Page::relativePagePath()` when `Page::$name` is not defined
* Fix for poor handling of params + query element in `Uri::processParams()` [#859](https://github.com/getgrav/grav/issues/859)
* Fix for double encoding in markdown links [#860](https://github.com/getgrav/grav/issues/860)
# v1.1.0-beta.5
## 05/23/2016

View File

@@ -300,7 +300,7 @@ trait ParsedownGravTrait
if (isset($url['query'])) {
$actions = array_reduce(explode('&', $url['query']), function ($carry, $item) {
$parts = explode('=', $item, 2);
$value = isset($parts[1]) ? $parts[1] : true;
$value = isset($parts[1]) ? rawurldecode($parts[1]) : true;
$carry[$parts[0]] = $value;
return $carry;

View File

@@ -289,6 +289,8 @@ class ParsedownTest extends \Codeception\TestCase\Test
$this->parsedown->text('[cnn.com](http://www.cnn.com)'));
$this->assertSame('<p><a href="https://www.google.com">google.com</a></p>',
$this->parsedown->text('[google.com](https://www.google.com)'));
$this->assertSame('<p><a href="https://github.com/getgrav/grav/issues/new?title=%5Badd-resource%5D%20New%20Plugin%2FTheme&body=Hello%20%2A%2AThere%2A%2A">complex url</a></p>',
$this->parsedown->text('[complex url](https://github.com/getgrav/grav/issues/new?title=[add-resource]%20New%20Plugin/Theme&body=Hello%20**There**)'));
}
public function testExternalLinksSubDir()