mirror of
https://github.com/getgrav/grav.git
synced 2026-03-02 10:31:41 +01:00
Fixed twig url() failing if stream has extra slash in it (e.g. user:///data)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
* Fixed `ignore_empty: true` not removing empty values in blueprint filtering
|
||||
* Fixed `{{ false|string }}` twig to return '0' instead of ''
|
||||
* Fixed `Data::filter()` removing empty fields (such as empty list) by default
|
||||
* Fixed twig `url()` failing if stream has extra slash in it (e.g. `user:///data`)
|
||||
* Grav 1.7: Fixed `Flex Pages` unserialize issues if Flex-Objects Plugin has not been installed
|
||||
* Grav 1.7: Require Flex-Objects Plugin to edit Flex Accounts
|
||||
|
||||
|
||||
@@ -918,9 +918,14 @@ class Uri
|
||||
{
|
||||
$grav = Grav::instance();
|
||||
|
||||
// Remove extra slash from streams, parse_url() doesn't like it.
|
||||
if ($pos = strpos($url, ':///')) {
|
||||
$url = substr_replace($url, '://', $pos, 4);
|
||||
}
|
||||
|
||||
$encodedUrl = preg_replace_callback(
|
||||
'%[^:/@?&=#]+%usD',
|
||||
function ($matches) {
|
||||
static function ($matches) {
|
||||
return rawurlencode($matches[0]);
|
||||
},
|
||||
$url
|
||||
@@ -940,7 +945,7 @@ class Uri
|
||||
$parts['path'] = '';
|
||||
}
|
||||
|
||||
list($stripped_path, $params) = static::extractParams($parts['path'], $grav['config']->get('system.param_sep'));
|
||||
[$stripped_path, $params] = static::extractParams($parts['path'], $grav['config']->get('system.param_sep'));
|
||||
|
||||
if (!empty($params)) {
|
||||
$parts['path'] = $stripped_path;
|
||||
|
||||
Reference in New Issue
Block a user