Images in pages keep the address the site had at upload, so they break when the site moves
I maintainer di solito rispondono entro 1 giorno
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
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/imageinsystem/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, sohypha_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
- Upload an image in a text page on
http://a.example.org/. - Copy the data folder to a site at
http://b.example.org/, and switch offa.example.org. - Open the page on
b.example.org: the image points toa.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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Medium Level: Easy Type: Bug Value: Users
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Impact: Low Level: Easy Type: Bug Value: Coders
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
PlanBCode/hypha#586 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PlanBCode/hypha
Issue simili
-
FEATURE REQUEST
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
linuxmint/cinnamon-spices-extensions#1193 ·
I maintainer di solito rispondono entro 1 giorno
-
ds-bot collides with dsh-argp: tool "recall" is already registered, Bot layer never activatesApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Fei2411/DeepSeek-Bot#703 ·
-
area:web first-timers-only good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
career-ops-hq/career-ops#6264 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
catppuccin/firefox#21 ·
-
[Server Submission]: Wiro AIAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
cline/mcp-marketplace#3394 ·