From 95f10b57f370a930c8e4461e676e1f59466630a0 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 15 Aug 2022 13:25:08 -0600 Subject: [PATCH] Et2Image: Check that src from content is valid to avoid overwriting existing src attribute Happens in Kanban contact, src="email" but email has a value (an email address) --- api/js/etemplate/Et2Image/Et2Image.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/api/js/etemplate/Et2Image/Et2Image.ts b/api/js/etemplate/Et2Image/Et2Image.ts index b60c0a4408..97cfc51859 100644 --- a/api/js/etemplate/Et2Image/Et2Image.ts +++ b/api/js/etemplate/Et2Image/Et2Image.ts @@ -197,7 +197,8 @@ export class Et2Image extends Et2Widget(SlotMixin(LitElement)) implements et2_ID { super.transformAttributes(_attrs); - // Expand src with additional stuff. Copy & paste from legacy. + // Expand src with additional stuff + // This should go away, since we're not checking for $ or @ if(typeof _attrs["src"] != "undefined") { let manager = this.getArrayMgr("content"); @@ -208,9 +209,16 @@ export class Et2Image extends Et2Widget(SlotMixin(LitElement)) implements et2_ID { if(typeof src == "object") { - src = egw().link('/index.php', src); + this.src = this.egw().link('/index.php', src); + } + else if(this.src && this.egw().image(src)) + { + this.src = src; + } + else if(!this.src) + { + this.src = src; } - this.src = src; } } }