Design settings save throws string-offset TypeError for scalar options
维护者通常 1 天内回复
评估
调研方向
阅读 includes/classes/wp-maintenance-mode-admin.php,重点查看 Design 分支附近的 save_plugin_settings(),然后检查 tests/page-state-test.php 及其 save_design_settings() helper。使用标量 options 和标量 options[design] 重现一次经过身份验证的 Design 保存,然后与普通表单提交进行比较。当格式错误的选项形态被拒绝且不会产生未捕获的 TypeError,并且有效的 Design 保存仍通过现有测试时,即达到目标。
由索引模型根据 Issue 内容生成。
描述
Summary
Saving Design 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, Design 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=design, a valid tab-design nonce, and either string-valued options or string-valued options[design]. The source reaches the reported offset access after its existing guards. The actual captured payload and PHP version are unavailable.
Diagnosis
Conclusion
The captured Design 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–417 and 468–472,WP_Maintenance_Mode_Admin::save_plugin_settings(): capability, nonce, and tab checks precede the Design branch, but neither options container is type-validated before accessing$_POST['options']['design']['title']. A string-valued container can produce the recorded TypeError at line 470 before field sanitization completes.views/settings.phplines 203 and 337–346, Design settings form: ordinary markup submits nested Design option 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 structure is submitted POST data rather than the saved settings option. The path requires passing capability, nonce, and tab checks. Ordinary form markup is array-shaped; the origin of scalar data in the captured requests is unknown. The failure occurs while evaluating the field access, independently of the field sanitizer's behavior. No anonymous exploit or broader frontend failure is established.
Test coverage status
tests/page-state-test.php lines 186–214, Test_Page_State::save_design_settings(), constructs an array-shaped Design submission; test_design_form_save_switches_selection_through_the_same_lifecycle() begins at line 217. No relevant scalar-container coverage was found during inspection. 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 Design save with a valid tab nonce and scalar
options, then with scalaroptions[design]. - Compare responses with an ordinary Design 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 affected tag contains an unguarded Design field access at the exact captured error line, consistent with a scalar options container.
Source: automated uninstall feedback — wp-maintenance-mode, 2026-11-04
Generated by bug-report-triage (ID: bug-report-triage_6aec0d90cde642.94809936)
- 主要语言
- PHP
- 星标
- 163
- 派生
- 82
- 平均合并
- 4 小时 2 分钟
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Codeinwp/wp-maintenance-mode 的其他 Issue
-
General settings save throws string-offset TypeError for scalar options可能已有人在做 @girishpanchal30 于 2 天前认领。 未关闭bug-report bug-report-triage
难度 2/5 1-3 小时 新手友好度 78/100
Codeinwp/wp-maintenance-mode#595 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
customer report feature-request-triage
难度 5/5 一周以上 新手友好度 30/100
Codeinwp/wp-maintenance-mode#587 · 2 条评论 ·
维护者通常 1 天内回复
-
feature-request-triage
难度 3/5 1-2 天 新手友好度 70/100
Codeinwp/wp-maintenance-mode#586 ·
维护者通常 1 天内回复
-
feature-request-triage
难度 4/5 3-5 天 新手友好度 50/100
Codeinwp/wp-maintenance-mode#550 · 1 条评论 ·
维护者通常 1 天内回复
-
feature-request-triage
难度 5/5 一周以上 新手友好度 45/100
Codeinwp/wp-maintenance-mode#549 ·
维护者通常 1 天内回复
查看 Codeinwp/wp-maintenance-mode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
getgrav/grav-plugin-form#664 ·
-
claude
难度 2/5 1-3 小时 新手友好度 82/100
sprain/sprainocchio#26 ·
-
sync-en
难度 1/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
sync-en
难度 1/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 83/100
GSA/digital-gov-drupal#569 ·
维护者通常 2 天内回复