Skip to content

Weird HTML entities behavior in repeater item labels #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CalleRosa40 opened this issue Dec 16, 2016 · 2 comments
Closed

Weird HTML entities behavior in repeater item labels #117

CalleRosa40 opened this issue Dec 16, 2016 · 2 comments

Comments

@CalleRosa40
Copy link

CalleRosa40 commented Dec 16, 2016

Short description of the issue

Uppercase umlaut HTML entities (Ö / Ä / Ü) are displayed in repeater item label. The label is pulled from a page's default title field (HTML Entity Encoder text formatter is set). Page is added to repeater via Page field set to "single page".

Expected behavior

Entities should be converted to the actual characters: ÄÖÜ.

Actual behavior

Screenshot:
grafik

However, there's more ... If the page's title contains ä, ö, ü or ß, all umlauts are displayed correctly. Just one of these characters suffices to fix all other characters.

Screenshot (notice the final "ß"):
grafik

  • ProcessWire version: 3.0.42
@kixe
Copy link

kixe commented Jan 19, 2017

The regex in class Inputfield should detect uppercase letters too
https://github.com/processwire/processwire/blob/dev/wire/core/Inputfield.php#L1550
solution: change to:
if(strpos($str, '&') !== false && preg_match('/&(#\d+|[a-zA-Z]+);/', $str)) {

ryancramerdesign added a commit to processwire/processwire that referenced this issue Feb 2, 2017
@ryancramerdesign
Copy link
Member

Thanks I've pushed the suggested fix for this issue to the dev branch. Note that if you are literally inserting HTML entities like Ö into your repeater label, make sure you use the actual character Ö instead, as typing in literal HTML entities in anything in the admin is likely going to result in it getting double-encoded in most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants