Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently there is only one
Utils::encode()
method which gets used to encode URLs as well as textual content.For example in
PrestaSitemapBundle/src/Sitemap/Url/UrlConcrete.php
Line 202 in 62bf18a
the
<loc>
gets encoded withPrestaSitemapBundle/src/Sitemap/Utils.php
Line 40 in 62bf18a
With the following code
the generated XML is:
Actually this is not a valid URL according to RFC3986 (also see https://stackoverflow.com/questions/1856785/characters-allowed-in-a-url for summary). Although such URLs work when being called in a browser because the browser URL-encodes it, this library should follow the RFC imho.
With this PR above code would generate this XML:
This is exactly the same as when you call http://example.org/umlaut_url_ä in your browser and then copy-paste the URL to a text editor.