Skip to content

Commit

Permalink
Avoid using string values as callables
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Apr 3, 2024
1 parent 5670e48 commit 82593b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# SEOMate Changelog

## 2.2.1 - 2024-04-04
### Fixed
- Fixed a bug where SEOMate could attempt to use string values as callables in `additionalMeta`

## 2.2.0 - 2024-01-19
### Added
- Sitemaps now include alternate URLs in `<xhtml:link>` entries, if the `outputAlternate` config setting is `true`. [#79](https://github.com/vaersaagod/seomate/pull/79)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vaersaagod/seomate",
"description": "SEO, mate! It's important.",
"type": "craft-plugin",
"version": "2.2.0",
"version": "2.2.1",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion src/services/MetaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public function processAdditionalMeta(array $meta, array $context = [], Settings
}

foreach ($settings->additionalMeta as $key => $value) {
if (\is_callable($value)) {
if ($value instanceof \Closure) {
$r = $value($context);
$value = $r;
}
Expand Down

0 comments on commit 82593b3

Please sign in to comment.