Skip to content

German Umlauts in links not correctly encoded #1673

@vitus-prediger

Description

@vitus-prediger

Describe the bug

German umlauts not correctly encoded in loc URLS.

To reproduce

Steps to reproduce the behaviour:

  1. Go to our blog-3-sitemap.xml
  2. Search for prediger-zu-besuch-bei-sattler and check the URL in <image:loc>
  3. See that it contains Körner

Expected behaviour

To avoid confusion and parsing errors, german umlauts should be % encoded in all sitemap URLs.

Technical details

In the file helpers/Sitemap.php:592 $asset->getUrl() already returns the correctly encoded URL for the asset which gets run through UrlHelper::absoluteUrlWithProtocol() which in turns calls TextHelper::sanitizeUserInput() down the line and rawurldecode's the URL again in helpers/Text.php:340. That removes the % encoding again.

Screenshots

Image

Versions

  • Plugin version: dev-develop-v5 as 5.1.13
  • Craft version: 5.8.15

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions