Non-ASCII source URLs move to opaque segment-<hash> slugs; WordPress supports UTF-8 slugs natively
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 56/100
Hướng nghiên cứu
Start with php-transformer/src/Path/RouteSlug.php and its RouteSlug docblock to understand why non-ASCII segments become hashes. Trace how that result is used for post_name, permalinks, navigation links, templates, and route classes, then locate the relevant fixture tests. Done means Arabic and CJK routes retain distinct native WordPress slugs in stored post names, permalinks, and nav links while internal identities remain valid.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
RouteSlug::segment() replaces any path segment that does not fold to ASCII (Arabic, CJK, Cyrillic, Greek, Hebrew) with the opaque token segment-<sha256[:12]>. That token becomes the page's post_name, its permalink, and its template slug. Every non-Latin source URL therefore moves. A 301 keeps old links working, but the imported site's own URLs are hashes that the owner cannot read or recognize.
WordPress has no such limit: sanitize_title_with_dashes() keeps UTF-8 letters, percent-encoded through utf8_uri_encode(), so /الصور/ is a normal WordPress permalink. #3331 treated a moved source URL as a bug (underscores); this is the same class of fidelity loss, at site scale for non-Latin sites.
Evidence (mostafa-atef.com, Arabic Wix site, DLA 0.43.24, SSI 1.42.31)
- 31 of 47 imported pages have
post_namesegment-*. Titles stay correct Arabic. GET /الصور/returns301 → /segment-bfbd183ae97c/, and the nav links point at/segment-…/.- Templates are named
page-segment-6ea79cc5df8c, which is opaque in the Site Editor.
Context
The current design is deliberate (see the RouteSlug docblock): the canonical route grammar is [a-z0-9_-], so segments that WordPress would percent-encode get a derived token. The question is where that grammar needs to hold:
- Internal identities (template slugs, CSS route classes, artifact paths) can keep an ASCII token.
- The public route (
post_name, permalinks, nav hrefs) can carry WordPress's own slug for the segment, so the source URL is preserved.
Expected / acceptance
- A non-ASCII source path imports with WordPress's native slug for that path.
/الصورstays/الصور/(stored percent-encoded, as core stores it), with no redirect needed. - Template and route-class identities stay valid under their own grammars.
- Two distinct non-ASCII segments never collide.
- A fixture with an Arabic and a CJK route asserts the stored
post_name, the permalink, and the nav hrefs.
Filed by Franklin (Claude Opus via Roadie/Pi) from the mostafa-atef.com import loop. Evidence comes from the imported site's wp post list, curl, and php-transformer/src/Path/RouteSlug.php on trunk.
- Ngôn ngữ chính
- PHP
- Star
- 31
- Fork
- 7
- Merge trung bình
- 7 giờ 50 phút
- Pull request đã merge (30 ngày)
- 822
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Automattic/blocks-engine
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Automattic/blocks-engine#7679 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/blocks-engine#4943 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/blocks-engine#4942 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Automattic/blocks-engine#4921 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Automattic/blocks-engine#775 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Automattic/blocks-engine
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Automattic/static-site-importer#3462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpĐang mởenhancement feature: settings good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
nextcloud/integration_openai#480 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
a11y
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
omeka/plugin-Contribution#84 ·