Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Page names lose every letter outside ASCII: Café becomes Caf, a Greek name becomes _

Đang mở
#543 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, php

Hướng nghiên cứu

Start with validatePagename() in system/core/pages.php:402 and its JavaScript twin in the new page popup; reproduce with the supplied Unicode examples. Read the related lookup and index locations in base.php and index.php, and check the dependencies on #541 and #516. Done means Unicode names are preserved and normalized consistently, lookups and headings handle them, and the reported cases work across page creation, renaming, and settings.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Component: User interface Impact: Medium Level: Moderate Pagetype: Mailinglist Pagetype: Text Type: Bug Usecase: De Stadsbron Value: Users

validatePagename() (system/core/pages.php:402) and its JavaScript twin in the new page popup keep only [\s\d\w\-_]. Without the /u modifier (PHP) or the u flag (JavaScript), \w is ASCII only, so every byte of a letter outside ASCII is removed:

Typed name Page name
Café Ëenhoorn naïef façade Caf_enhoorn_naef_faade letters lost
Straße Größe Äpfel Strae_Gre_pfel
Café typed decomposed (e + U+0301) Cafe differs from the precomposed form
Αθήνα καλημέρα (Greek) _ the page index then hangs (#514)
東京都の図書館 (empty) error
Feest 🎉 👩‍👩‍👧 🇳🇱 Feest___
10 km with a non-breaking space 10km words glued
Été and then été t, then "page exists" different words collide

The same function is used for renaming a text page and a mailing list and for the default page in settings. Pages that are made through a link (wikify_link()) do keep their full name, which is inconsistent.

Related: lookups are case-insensitive for ASCII only, because strtolower() does not change É or Α (PHP 8 is locale-independent): hypha_getPage() (base.php:549), the page chooser of the link dialog (pages.php:352: écl does not find Éclair), hypha_getUserByName() (base.php:415) and the sorting in the page index (index.php:51). And index.php:58 takes the first byte of the name as its letter heading.

Steps to reproduce (fictional site, PHP 8.2 container of docs/container): log in, new page, type Café de Kroon, create: the page is Caf_de_Kroon.

Suggested fix (not a small change, so no pull request yet):

  1. Keep letters, marks and digits of every script: preg_replace('/[^\p{L}\p{M}\p{N}\s_-]/u', '', $name) in PHP and /[^\p{L}\p{M}\p{N}\s_-]/gu in the popup; treat every Unicode space (/\s+/u, which includes the non-breaking space) as a space.
  2. Normalize the name to NFC when the intl extension is there (Normalizer::normalize()), so precomposed and decomposed input give the same page.
  3. Compare names with mb_strtolower() (mbstring) in the lookups above.
  4. This needs #541 (percent-decoding of the request path), else such pages give 404, and #516 (#514), else a name that starts with É makes the page index hang.

Found while testing Unicode for the Markdown editor (#520). Tested in the PHP 8.2 container of docs/container with a fictional test site: reproduces on main (d97ab7b).

Ngôn ngữ chính
JavaScript
Star
5
Fork
9
Merge trung bình
18 giờ 7 phút
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PlanBCode/hypha

Tất cả issue của PlanBCode/hypha

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.