Automattic / Automattic/jetpack

Related Posts: Issue with non-latin characters in file names + AMP

Open
#16,178 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Related Posts [Pri] Low AMP Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

1. Start with a site with AMP enabled.
2. Turn on Related Posts.
3. Set up a post with a non-latin or accented character in the featured image's file name.
4. View a post where you first post will appear as a related post (it might be easiest to edit an existing related post to add your image).

#### What I expected
The Related Posts will display as usual.

#### What happened instead

The featured image with the accent/non-latin character in the file name is sized oddly. AMP is adding classes like `amp-wp-unknown-size`, and the characters with accents (in this example) are encoded. This only seems to happen when AMP is enabled, and only in the Related Posts -- the other spots that the Featured Images are displayed appear to use the accents in the URL.

**Screenshots**
![image](https://user-images.githubusercontent.com/177561/84810270-f8712380-afbf-11ea-8f75-582a3065fa47.png)

![image](https://user-images.githubusercontent.com/177561/84810474-3cfcbf00-afc0-11ea-89df-f36a7b0d1b15.png)

I did see https://wordpress.org/plugins/clean-image-filenames/ recommended in https://github.com/Automattic/jetpack/issues/14495, but wanted to report this, just in case! Please let me know if it should be moved to the amp-html/amp-wp repos instead.

Contributor guide

Open the contributing guide

Research direction

No file or test is named. Reproduce the issue with AMP and Related Posts using a featured image whose filename contains accented or non-Latin characters, then trace the Related Posts image rendering and URL handling. Done means the image keeps normal sizing and its filename renders correctly in AMP, matching other featured-image locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.