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

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

Đang mở
#640 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

@guidol-ive đang làm issue này rồi.

Từ ngày 28/10/2026.

  • #641 của @guidol-ive — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
backend

Hướng nghiên cứu

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.

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

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.