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

Images in pages keep the address the site had at upload, so they break when the site moves

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

I maintainer di solito rispondono entro 1 giorno

@guidol-ive ci sta già lavorando.

Dal 28/10/2026.

  • #641 di @guidol-ive — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
backend

Direzione di ricerca

Start in system/core/pages.php at the upload/image handler, then trace how the editor stores its returned URL and how hypha_make_relative() is used. Check the linked pull request #641 for the current approach. Done means uploaded images are stored as relative images/<file> paths and continue loading after the site address changes.

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

Descrizione

Component: User interface Impact: Medium Type: Bug Value: Visitors

Problem

After a site moves to another address, the images in its text pages and articles no longer show. The browser asks the old address for them, for example https://old.example.org/images/5f0c0ffee0b1a.png, while the file is in data/images of the site at the new address.

The same happens when the old address still answers but no longer serves the images (it gives a 404 or 500).

Cause

  • The image upload (upload/image in system/core/pages.php) answers with an absolute URL: $hyphaUrl . 'images/...'.
  • The editor puts that URL in the text as it is.
  • Text pages and articles do not run wikify() on save, so hypha_make_relative() never makes the URL relative.

So the stored text holds the scheme and host of the site at the time of the upload. Behind a proxy that terminates TLS, the scheme can also be wrong (see #398).

To reproduce

  1. Upload an image in a text page on http://a.example.org/.
  2. Copy the data folder to a site at http://b.example.org/, and switch off a.example.org.
  3. Open the page on b.example.org: the image points to a.example.org.

Expected

The site serves its own images, whatever address it had when they were uploaded: a relative images/<file>.

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.