Fix warning: Illegal string offset 'hex' by adding ternary fallback to white#2110
Fix warning: Illegal string offset 'hex' by adding ternary fallback to white#2110bassplayer7 wants to merge 5 commits intodompdf:developfrom
Conversation
Prepare for 0.8.4 release
Final update for 0.8.4
Preparation for 0.8.5 release
|
Can you rebase your branch on the develop branch? |
|
Do you have some sample HTML + CSS that exhibits the issue? |
|
No HTML/CSS, but I can reproduce the warning with manually setting styles: So there are some inconsistencies to how the getters and property accessors work. |
|
So I think the commit as-is is probably not the right thing to do. |
|
Good analysis. I've been focusing on issues reproducible during rendering, but we should avoid issues like this one even in direct-usage scenarios. |
|
An example reproducing the issue is in #2367 (comment). |
|
Per example in issue 2367 if a named color is known but not translated (e.g. transparent) the error is raised. Though I still can't trigger the error in the method modified in this PR. Also, the $color variable is referenced multiple times and if we're tweaking the logic here should we also tweak it in the other locations? Anyway, I would expect this particular case would have a valid array since we're retrieving the color through the style color getter. So I think maybe we can fix this without the ternary by fixing the getter. |
|
I think the small change I made in #2536 works better for the expected return values to address this issue. |
No description provided.