diff --git a/src/flextype/Foundation/Parsers/Parser.php b/src/flextype/Foundation/Parsers/Parser.php index 7b1d2cd6..49540dbe 100644 --- a/src/flextype/Foundation/Parsers/Parser.php +++ b/src/flextype/Foundation/Parsers/Parser.php @@ -86,22 +86,22 @@ class Parser } break; - case 'shortcodes': - if ($cache === true && $this->flextype['registry']->get('flextype.settings.cache.enabled') === true) { - $key = md5($input); + case 'shortcodes': + if ($cache === true && $this->flextype['registry']->get('flextype.settings.cache.enabled') === true) { + $key = md5($input); - if ($data_from_cache = $this->flextype['cache']->fetch($key)) { - return $data_from_cache; - } - - $data = $this->flextype['shortcodes']->process($input); - $this->flextype['cache']->save($key, $data); - - return $data; - } else { - return $this->flextype['shortcodes']->process($input); + if ($data_from_cache = $this->flextype['cache']->fetch($key)) { + return $data_from_cache; } + $data = $this->flextype['shortcodes']->process($input); + $this->flextype['cache']->save($key, $data); + + return $data; + } else { + return $this->flextype['shortcodes']->process($input); + } + break; default: // code... diff --git a/src/flextype/Foundation/Parsers/shortcodes/UrlShortcodeExtension.php b/src/flextype/Foundation/Parsers/shortcodes/UrlShortcodeExtension.php index 4375be28..59aa979d 100644 --- a/src/flextype/Foundation/Parsers/shortcodes/UrlShortcodeExtension.php +++ b/src/flextype/Foundation/Parsers/shortcodes/UrlShortcodeExtension.php @@ -14,9 +14,9 @@ use Slim\Http\Uri; // Shortcode: [url] $flextype['shortcodes']->addHandler('url', static function () use ($flextype) { - if ($flextype['registry']->has('flextype.settings.url') && $flextype['registry']->get('flextype.settings.url') != '') { + if ($flextype['registry']->has('flextype.settings.url') && $flextype['registry']->get('flextype.settings.url') !== '') { return $flextype['registry']->get('flextype.settings.url'); - } else { - return Uri::createFromEnvironment(new Environment($_SERVER))->getBaseUrl(); } + + return Uri::createFromEnvironment(new Environment($_SERVER))->getBaseUrl(); });