From 20e7166eed03ea7ba9efd81f994c5000834a1c15 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 31 Mar 2022 21:32:28 +0300 Subject: [PATCH] Fixed `Utils::resolveTokenPath()` with `@variable@` not working properly --- CHANGELOG.md | 1 + system/src/Grav/Common/Utils.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b964d730..130b2059d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * By default, add media to only pages which have been initialized in pages loop 3. [](#bugfix) * Fixed locking and reading files using `Framework\File` classes + * Fixed `Utils::resolveTokenPath()` with `@variable@` not working properly # v1.7.33 ## mm/dd/2022 diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index 50c829406..b84515bfc 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -1720,7 +1720,7 @@ abstract class Utils protected static function resolveTokenPath(string $path): ?array { if (strpos($path, '@') !== false) { - $regex = '/^(@\w+|\w+@|@\w+@)([^:]*)(.*)$/u'; + $regex = '/^(@\w+@|@\w+|\w+@)([^:]*)(.*)$/u'; if (preg_match($regex, $path, $matches)) { return [ trim($matches[1], '@'),