getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 227 forks source link

Unsaved content is lost when XSS warning is displayed #2103

Open uviArtisol opened 3 years ago

uviArtisol commented 3 years ago

Every time I get an XSS warning, whatever content I had writen before saving is lost. Can we get the warning (and a reference to which is the offending text) without reloading the page to the last saved position. The solution is to save all the time, but because Grav scrolls all the way back up when saved, it makes it impossible to work on any document longer than your screen.

mahagr commented 3 years ago

I cannot replicate it.

When I add a script tag into the content of a page and attempt to save it, it warns me and shows You are editing a saved draft.

I can still see the script in the content as well as my other changes.

thekenshow commented 2 years ago

I'm seeing similar behaviour under the following conditions:

    <div class="embed-container-map">
        <iframe src="https://embed.kumu.io/305db4a26b7dfd11b065b9b3f9165328" style="border:0">
        </iframe>
    </div>

Screen Shot 2021-12-23 at 5 15 39 PM

NOTE Editing the snippet a second time and saving again works as expected.