Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#543 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, php

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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).

Lingua principale
JavaScript
Stelle
5
Fork
9
Merge medio
18h 7m
PR unite (30g)
11

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PlanBCode/hypha

Tutte le issue di PlanBCode/hypha

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.