-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Lizmap 3.8 regression : tooltip HTML is not properly rendered in popups anymore #4990
Comments
This is expected now. See for example #4914 or #4707 It wasn't advised, even before 3.8 to use This was a security issue, related to XSS. Theses fixes started from version 3.6, continued in 3.7 and was then finished in 3.8.
Are you sure it's the same |
Indeed, there is a difference in the HTML, for instance in QGIS HTML maptip : <p>First P block 1</p>
<p>
Begin new P block 2
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
End P block 2
</p> It gives in LWC : <p>First P block 1</p>
<p>
Begin new P block 2
</p><ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
End P block 2
<p></p> |
Thanks for the information. The Anyway, how am I supposed to reproduce this behaviour with Lizmap Javascript signals (https://docs.lizmap.com/current/en/publish/customization/javascript.html#available-javascript-events) For example, What I am trying to do is to render a specific custom code inside a popup. Previously I used to work with iframes but this time I tried to do things cleaner with native Lizmap JS/HTML. Should I continue to embed external content ? |
The security issue was to load external JavaScript which was not part of the core main Lizmap Web Client application and the dedicated
I was curious as well and I look on GitHub : either in this repository, or in the javascript-script-library repository :
I tried this just now, I will let other comment if there is something : lizMap.events.on({
lizmappopupdisplayed: function (popup) {
let popupContainer = document.getElementById(popup.containerId);
if (!popupContainer) return false;
Array.from(popupContainer.querySelectorAll('div.lizmapPopupContent input.lizmap-popup-layer-feature-id')).map(element => {
let val = element.value;
let featureId = val.split('.').pop();
let layerId = val.replace('.' + featureId, '');
console.log(featureId)
console.log(layerId)
});
}
});
I'm not sure what you mean by "external content", but iframe is supported. |
I made a PR to make something a little bit easier #4992 |
Thanks |
I could fix my popup thanks to your help. I am wondering what do you mean exactly in 3.8 changelog by
I visited this doc, but it does not help me : https://docs.3liz.org/lizmap-web-client/js/module-FeatureToolbar.html |
What is the bug? (in English)
Since 3.8 updates, HTML in QGIS tooltip does not seem to be rendered properly.
For exemple this tooltip used to be rendered properly. In 3.8
<ul>
in not inside<p>
anymore)<script>
part is missingSteps to reproduce the issue
Just load the attached project in Lizmap 3.8
lizmap_regression_popup.zip
It contains a layer with popup HTML configured as
it renders as
And the script is removed.
Versions, safeguards, check summary etc
Versions :
List of Lizmap Web Client modules :
* saas : 1.7.4 * webdav : 1.1.6
List of safeguards :
* Mode : normal
* Allow parent folder : no
* Prevent other drive : yes
* Prevent PG service : no
* Prevent PG Auth DB : yes
* Force PG user&pass : yes
* Prevent ECW : yes
Check Lizmap plugin
Operating system
Lizmap hosting
Browsers
Chrome
Browsers version
Version 1.69.0 (55816)
Relevant log output
No response
The text was updated successfully, but these errors were encountered: