Skip to content

Commit

Permalink
FIX Multi HTML entities in shortcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Aug 7, 2023
1 parent 2a56cc3 commit 6f25498
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Forms/TextareaField.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ public function Type()
*/
public function ValueEntities()
{
return htmlentities($this->Value() ?? '', ENT_COMPAT, 'UTF-8');
return htmlentities($this->Value() ?? '', ENT_COMPAT, 'UTF-8', false);
}
}
9 changes: 9 additions & 0 deletions tests/php/Forms/TextareaFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,14 @@ public function testValueEntities()
false,
$field->obj('ValueEntities')->getProcessShortcodes()
);

$inputText = "The company & partners";
$field = new TextareaField("Test", "Test");
$field->setValue($inputText);

$this->assertEquals(
"The company & partners",
$field->obj('ValueEntities')->forTemplate()
);
}
}

0 comments on commit 6f25498

Please sign in to comment.