GithubHelp home page GithubHelp logo

Comments (6)

wachterjohannes avatar wachterjohannes commented on June 13, 2024

Thanks for the report :) but we explicitly allow all the HTML tags and attributes in the editor. You can decide if you want to render the content in raw (twig filter). We do this because we don't see the big problem here because the content-manager (logged in system user) should be "competent" enough to avoid it if he doesn't want it.

But we are planning in a future release to make this behavior configurable - there are no concrete plans currently.

/cc @chirimoya @danrot please add your thoughts about this topic

from sulu-standard.

danrot avatar danrot commented on June 13, 2024

I also think that this is the job of the template developer. Especially because I have already seen textareas being used to copy small javascript snippets (e.g. Youtube embed codes).

from sulu-standard.

floatingbits avatar floatingbits commented on June 13, 2024

I've been running into issues because the code is not only rendered unsanitized on the webpage/preview, but also in the block preview in the actual edit page.
It's quite disturbing when you want to paste one of the new (?) responsive vimeo.com embed codes which load a js file which seems to break sulus backend js up to the point that you aren't able to save the page anymore...
But then, I'm on 1.4, maybe 1.6 has got a different behaviour?

from sulu-standard.

alexander-schranz avatar alexander-schranz commented on June 13, 2024

@floatingbits only the ckeditor run JS codes but there it is run inside an iframe and should not crash any backend components. and for embed codes its recommend use textareas and not texteditors. So update to 1.6 should fix it for textareas.

from sulu-standard.

floatingbits avatar floatingbits commented on June 13, 2024

Hmmm. I do use a textarea. The html is output without any sanitizing to the block preview.
The code that breaks the whole edit page is a simple vimeo embed code featuring a script tag:

<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/267254114?title=0&byline=0&portrait=0" style="position:absolute;top:0;left:0;width:100%;height:100%;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>

My blocks (without the breaking script tag) look like this:
screenshot from 2018-05-09 10-53-28
screenshot from 2018-05-09 10-55-52

EDIT: Ahh, ok. The update to 1.6 should fix it :-)

from sulu-standard.

alexander-schranz avatar alexander-schranz commented on June 13, 2024

for @prodigysml if you don't want to output something on the website you maybe need to create a custom twig extension using something like http://htmlpurifier.org.

@floatingbits thats good.

I will know close the issue as it seems to be fixed, else feel free to reopen it or add a comment.

from sulu-standard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.