General settings save throws string-offset TypeError for scalar options
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Đọc includes/classes/wp-maintenance-mode-admin.php quanh WP_Maintenance_Mode_Admin::save_plugin_settings() và biểu mẫu General trong views/settings.php. Trước tiên, kiểm tra cách options dạng scalar và options[general] đi đến phần truy cập trạng thái, sau đó bổ sung kiểm thử cho các lần gửi sai định dạng bên cạnh các kiểm thử cài đặt hiện có. Công việc hoàn tất khi các dạng yêu cầu không hợp lệ bị từ chối mà không gây ra TypeError chưa được bắt, đồng thời việc lưu cài đặt General thông thường vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Saving General settings can terminate with TypeError: Cannot access offset of type string on string when the submitted options structure contains a string where an array is expected. Invalid settings submissions are expected to be rejected without an uncaught exception. The captured failure aborts the settings-save request.
Customer context
- Product / area: LightStart, General settings save
- Version: 2.6.25
- Environment: PHP and WordPress versions not provided
- Reported error:
TypeError: Cannot access offset of type string on string - Impact: Settings-save request terminates
- Evidence: Error captured in two November 4 uninstall submissions; exact request bodies unavailable
Reproduction notes
Repository-derived reproduction, not executed: submit the authenticated settings-save action with tab=general, a valid tab-general nonce, and either string-valued options or string-valued options[general]. The source reaches the reported offset access after its existing guards. The actual captured payload and PHP version are unavailable.
Diagnosis
Conclusion
The captured General settings error matches a definite unchecked request-shape access in v2.6.25. This is source-backed confirmation, not an inference from the number of uninstall comments. The request body that produced the recorded error remains unknown.
Where this likely occurs
includes/classes/wp-maintenance-mode-admin.phplines 72–73,WP_Maintenance_Mode_Admin::__construct(): registerssave_plugin_settings()on the authenticated settings-save action.includes/classes/wp-maintenance-mode-admin.phplines 392–422,WP_Maintenance_Mode_Admin::save_plugin_settings(): checks capability, nonce, and tab membership, then directly accesses$_POST['options']['general']['status']without validating the container types. A string-valued container can produce the recorded TypeError at line 422.views/settings.phplines 85–94, General settings form: ordinary markup submits nestedoptions[general][status]fields.- Tagged v2.6.25 source matches the recorded line. Blame attributes the access to commit
72a22e07; the v2.6.24..v2.6.25 comparison leaves this handler unchanged, so no new regression is established.
Engineering notes
The failing value comes from POST data, not the persisted settings option. Reaching the access requires passing the existing capability, nonce, and tab checks. Normal form markup supplies an array-shaped payload; how the reported requests acquired a scalar container is unknown. No anonymous exploit or broader frontend failure is established. WordPress core was not runtime-verified.
Test coverage status
No relevant malformed-General-options coverage was found during inspection. tests/page-state-test.php lines 186–214, Test_Page_State::save_design_settings(), exercises a different settings branch with an array-shaped payload. PHP and Docker are unavailable in this environment, so tests and a local PHP reproduction were not run.
What to verify or explore next
- Reproduce an authenticated General save with a valid tab nonce and scalar
options, then with scalaroptions[general]. - Compare responses with an ordinary General form submission.
- Obtain the originating request shape and PHP version if available.
Unknowns / follow-up
The telemetry includes no request body or stack trace. The reason the malformed payload was submitted is not established.
Confidence
Confidence: 93/100
The captured error location matches an unchecked array-offset access in the affected release, with no request-container validation before it.
Source: automated uninstall feedback — wp-maintenance-mode, 2026-11-04
Generated by bug-report-triage (ID: bug-report-triage_6aec0d90cde642.94809936)
- Ngôn ngữ chính
- PHP
- Star
- 163
- Fork
- 82
- Merge trung bình
- 4 giờ 2 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Codeinwp/wp-maintenance-mode
-
bug-report bug-report-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Codeinwp/wp-maintenance-mode#596 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
customer report feature-request-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
Codeinwp/wp-maintenance-mode#587 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature-request-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
Codeinwp/wp-maintenance-mode#586 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature-request-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
Codeinwp/wp-maintenance-mode#550 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
feature-request-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
Codeinwp/wp-maintenance-mode#549 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Codeinwp/wp-maintenance-mode
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Automattic/blocks-engine#4621 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
YunoHost-Apps/snappymail_ynh#205 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Automattic/static-site-importer#2653 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug (unconfirmed) Search :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
FreshRSS/FreshRSS#9533 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
ExpressionEngine/ExpressionEngine#5453 ·
Maintainer thường phản hồi trong vòng 1 ngày