CKEditor convert back to text Symfony 3 and Doctrine ORM

user7768004

I created a blog with Symfony and I just include the CKEditor bundle

So whenever I tried to write an article I can format it with the bundle and store the article in my database. But when it's store in my database and I try to read it, it doesn't format normaly.

Can somebody help me with this.

This is the rendering of the article from my database with twig This is the rendering of the article from my database with twig

Alain Tiemblo

The problem is that |raw will also unescape malicious tags such as <script>, you definitely can't use |raw if any user can write texts in your rich-text editor.

With your debug console, just make the hidden textarea appear, and fill it with arbitrary code. Disable javascript to remove CKEditor auto-escaping, and see what's going on.

enter image description here

A better solution is to use HTMLPurifierBundle, it will not escape the safe tags such as <b>, <em>... but will remove untrusted ones such as <script>, <iframe> etc.

This bundle provides a |purify tag, that's the tag to remember.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Sql convert to orm doctrine Symfony2

From Dev

Why Symfony requires doctrine/orm

From Dev

Add custom Symfony console commands to Doctrine ORM

From Dev

Generating Entity Getters and Setters in Symfony / Doctrine ORM

From Dev

Cascaded persist not working (Doctrine ORM + Symfony 2)

From Dev

symfony 3 Argument 1 passed to [some service]::__construct() must be an instance of [something] instance of Doctrine\ORM\EntityRepository given

From Dev

symfony 3 Argument 1 passed to [some service]::__construct() must be an instance of [something] instance of Doctrine\ORM\EntityRepository given

From Dev

Symfony3, Missing argument 1 for Doctrine\ORM\EntityRepository::__construct(), how and why

From Dev

using ckeditor in symfony3

From Dev

using ckeditor in symfony3

From Dev

Files storage with doctrine and symfony 3?

From Dev

Symfony Form Error: "Expected argument of type "Doctrine\ORM\QueryBuilder", "Doctrine\ORM\Query" given"

From Dev

Symfony Form Error: "Expected argument of type "Doctrine\ORM\QueryBuilder", "Doctrine\ORM\Query" given"

From Dev

The Doctrine repository "Doctrine\ORM\EntityRepository" must implement Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface

From Dev

Invalidating doctrine ORM cache in a rabbitmq-consumer | Symfony2

From Dev

Symfony2: Call to undefined method Doctrine\ORM\QueryBuilder::getResult()

From Dev

create properly a ManyToMany Recursive / Reflexive relation with doctrine ORM (Symfony)

From Dev

Symfony2: Call to undefined method Doctrine\ORM\QueryBuilder::getResult()

From Dev

No identifier specified error Symfony2 Doctrine ORM mapping

From Dev

Symfony2 Doctrine ORM cascade detach not working

From Dev

create properly a ManyToMany Recursive / Reflexive relation with doctrine ORM (Symfony)

From Dev

try catch orm doctrine on symfony3.3 syntax

From Dev

jQuery Convert Html To Text And Back

From Dev

Inject doctrine dbal in service with symfony 3

From Dev

Relation ManyToMany with doctrine/symfony3

From Dev

Right join query in symfony3 with doctrine

From Dev

Symfony 3: Doctrine stores NULL values in database

From Dev

Right join query in symfony3 with doctrine

From Dev

Symfony 3 : Doctrine:schema:update returns ConnexionException

Related Related

  1. 1

    Sql convert to orm doctrine Symfony2

  2. 2

    Why Symfony requires doctrine/orm

  3. 3

    Add custom Symfony console commands to Doctrine ORM

  4. 4

    Generating Entity Getters and Setters in Symfony / Doctrine ORM

  5. 5

    Cascaded persist not working (Doctrine ORM + Symfony 2)

  6. 6

    symfony 3 Argument 1 passed to [some service]::__construct() must be an instance of [something] instance of Doctrine\ORM\EntityRepository given

  7. 7

    symfony 3 Argument 1 passed to [some service]::__construct() must be an instance of [something] instance of Doctrine\ORM\EntityRepository given

  8. 8

    Symfony3, Missing argument 1 for Doctrine\ORM\EntityRepository::__construct(), how and why

  9. 9

    using ckeditor in symfony3

  10. 10

    using ckeditor in symfony3

  11. 11

    Files storage with doctrine and symfony 3?

  12. 12

    Symfony Form Error: "Expected argument of type "Doctrine\ORM\QueryBuilder", "Doctrine\ORM\Query" given"

  13. 13

    Symfony Form Error: "Expected argument of type "Doctrine\ORM\QueryBuilder", "Doctrine\ORM\Query" given"

  14. 14

    The Doctrine repository "Doctrine\ORM\EntityRepository" must implement Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface

  15. 15

    Invalidating doctrine ORM cache in a rabbitmq-consumer | Symfony2

  16. 16

    Symfony2: Call to undefined method Doctrine\ORM\QueryBuilder::getResult()

  17. 17

    create properly a ManyToMany Recursive / Reflexive relation with doctrine ORM (Symfony)

  18. 18

    Symfony2: Call to undefined method Doctrine\ORM\QueryBuilder::getResult()

  19. 19

    No identifier specified error Symfony2 Doctrine ORM mapping

  20. 20

    Symfony2 Doctrine ORM cascade detach not working

  21. 21

    create properly a ManyToMany Recursive / Reflexive relation with doctrine ORM (Symfony)

  22. 22

    try catch orm doctrine on symfony3.3 syntax

  23. 23

    jQuery Convert Html To Text And Back

  24. 24

    Inject doctrine dbal in service with symfony 3

  25. 25

    Relation ManyToMany with doctrine/symfony3

  26. 26

    Right join query in symfony3 with doctrine

  27. 27

    Symfony 3: Doctrine stores NULL values in database

  28. 28

    Right join query in symfony3 with doctrine

  29. 29

    Symfony 3 : Doctrine:schema:update returns ConnexionException

HotTag

Archive