0

I have the following html/php code:

<div class="col-xs-3 description-status-row" title = "'.$element['description'].'">
    '.$description.' 
</div>

$element['description'] contains special characters which is the ff:

NG - 55205 - Cannot execute Program line. Machine data read error (incorrect setup of MXF parameters). Center 1 :IF ( TX < RDM("ponte_registro""1"="" "mindgxcarrelgloy2") * 1 m) = " " " = " "

The <RDM part is messing up my codes and closing the </div> How do I prevent this from happening?

Qirel
  • 25,449
  • 7
  • 45
  • 62
Angela
  • 15
  • 4
  • Try using htmlspecialchars($element['descrption']) instead – Dylan KAS Jul 02 '19 at 08:20
  • `<` is being interperted as the opening tag of a HTML tag. Use `htmlspecialchars()` to replace it with `<`, so it appears the same visually, but doesn't break your HTML. – Qirel Jul 02 '19 at 08:24
  • Why using special characters in the title attribute of the div? You could clean it. – Giacomo M Jul 02 '19 at 08:26
  • Possible duplicate of [How to prevent XSS with HTML/PHP?](https://stackoverflow.com/questions/1996122/how-to-prevent-xss-with-html-php) – Dharman Jul 03 '19 at 21:55

0 Answers0