Repository navigation
Commit 51aa0b8
committed
Fix undefined property access on EmptyMduiElement
# If applied, this commit will
Prevent a fatal/warning-level PHP error when serializing IdP metadata
for an entity that has no mdui:Logo configured.
# Why is this change needed?
Prior to this change, JsonHelper::serializeIdentityProvider() always
accessed height, width and url on the value returned by
getMdui()->getLogo(), assuming it is always a Logo instance. When an
IdP has no logo, an EmptyMduiElement is returned instead, which did
not declare these properties. On PHP 8.2+ this produces "Undefined
property" warnings that get written to the response body before the
JSON payload, corrupting the API response for any consumer (such as
Profile) calling the metadata/idp endpoint for that entity.
# How does it address the issue?
This change adds public height, width and url properties (default
null) to EmptyMduiElement so it is structurally compatible with Logo
wherever the two are used interchangeably, without altering its
existing public API or JSON representation.
# Provide links to any relevant tickets, articles or other resources
Found while manually testing the WAYF remember-my-choice epic
end-to-end against a mock IdP without a configured logo.1 parent d64ec16 commit 51aa0b8
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| |||
0 commit comments