Skip to content

Commit 12fad0c

Browse files
committed
Merge branch 'release/4.1.17' into v4
2 parents 696893e + b5eff09 commit 12fad0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1877
-1897
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# SEOmatic Changelog
22

3+
## 4.1.17 - 2025.08.17
4+
### Changed
5+
* Use `StringHelper::convertToUtf8()` instead of our homebrew solution
6+
* Change `http` to `https` for schema.org type `@context`
7+
* Don't cache sitemaps if they are somehow generated via a Craft preview with token parameters ([#1636](https://github.com/nystudio107/craft-seomatic/issues/1636))
8+
9+
### Fixed
10+
* Fix an issue where emptying a section could cause the sitemap to throw an exception with certain versions of PHP ([#1629](https://github.com/nystudio107/craft-seomatic/issues/1629))
11+
* Fix weirdness in rendering of certain schema type descriptions of the source information was malformed with spurious spaces ([#1623](https://github.com/nystudio107/craft-seomatic/issues/1623))
12+
313
## 4.1.16 - 2025.06.11
414
### Fixed
515
* Removed `parseEnv` from the default `seomatic-sandbox.php`, because it is used by SEOmatic for rendering JSON-LD entity IDs ([#1616](https://github.com/nystudio107/craft-seomatic/issues/1616))

buildchain/package-lock.json

Lines changed: 552 additions & 616 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

buildchain/src/vue/SchemaTypeList.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<treeselect
66
ref="treeselect"
77
v-model="value"
8-
:multiple="false"
9-
:flat="false"
108
:default-expand-level="0"
11-
:options="options"
129
:disabled="disabled"
10+
:flat="false"
11+
:multiple="false"
12+
:options="options"
1313
/>
1414
</div>
1515
<div
@@ -19,11 +19,11 @@
1919
<div class="instructions">
2020
<p>
2121
<a
22-
:href="'http://schema.org/' + schemaName"
22+
:href="'https://schema.org/' + schemaName"
2323
rel="noopener"
2424
target="_blank"
2525
>{{ schemaName }} info: </a>
26-
<span v-html="renderHtml(schemaDescription)" />
26+
<span v-html="renderHtml(schemaDescription)"/>
2727
</p>
2828
<p v-if="Object.keys(schemaRichSnippetUrls).length">
2929
<a

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nystudio107/craft-seomatic",
33
"description": "SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 4. It is a turnkey SEO system that is comprehensive, powerful, and flexible.",
44
"type": "craft-plugin",
5-
"version": "4.1.16",
5+
"version": "4.1.17",
66
"keywords": [
77
"craft",
88
"cms",

docs/docs/using/index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,23 @@ This will output:
329329
* This property is recommended by Google.
330330

331331
If the site has `devMode` on, all of the meta objects are automatically validated as they are rendered, with the results displayed in the Yii Debug Toolbar. The Yii Debug Toolbar can be enabled in your account settings page.
332+
333+
## Unsafe User Input & SSTIs
334+
335+
A [server-side template injection](https://docs.cobalt.io/bestpractices/prevent-ssti/#best-practices) (SSTI) allows an attacker to execute server-side commands by injecting malicious data into a template.
336+
337+
SEOmatic guards against SSTIs by automatically sanitizing unsafe user input that it uses, but if you are manually setting SEOmatic variable to unsafe user input you will need to [sanitize the data](https://docs.cobalt.io/bestpractices/prevent-ssti/#sanitize-data) yourself.
338+
339+
Fortunately, SEOmatic provides a helper function to allow you to do just that:
340+
341+
```twig
342+
{% set primaryUrl = craft.app.request.getHostInfo %}
343+
{% set primaryUrl = seomatic.helper.sanitizeUserInput(primaryUrl) %}
344+
{% do seomatic.meta.setAttributes({
345+
canonicalUrl: primaryUrl
346+
}) %}
347+
```
348+
349+
Here are we using unsafe user input (the value of `hostInfo` from the `request`), and instead of using it directly, we are using the `seomatic.helper.sanitizeUserInput()` helper function to sanitize the unsafe user input before we set it to an SEOmatic variable.
350+
351+
**Note:** You do _not_ need to sanitize everything you set an SEOmatic variable to, only things that come from unsafe user input.

docs/docs/using/twig-sandbox.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Should you wish to customize it, you can copy the `seomatic-sandbox.php` to the
1010

1111
The `seomatic-sandbox.php` file in the Craft `config/` directory will be automatically used if it exists, instead of the built-in version of the file,
1212

13-
Here's what the default `seomatic-sandbox.php` looks like:
13+
Heres what the default `seomatic-sandbox.php` looks like:
1414

1515
```php
1616
<?php
@@ -139,7 +139,6 @@ return [
139139
'hiddenInput',
140140
'input',
141141
'parseBooleanEnv',
142-
'parseEnv',
143142
'plugin',
144143
'redirectInput',
145144
'renderObjectTemplate',

0 commit comments

Comments
 (0)