Commits

Toro Hill  committed eb0f3c5

Add EscapeInterface and escape class for html entities.

  • Participants
  • Parent commits 2ffd5a2

Comments (0)

Files changed (2)

File PhpTemplate/Escape/EscapeInterface.php

+<?php
+
+namespace PhpTemplate\Escape;
+
+interface EscapeInterface{
+	public function escape($value);
+}

File PhpTemplate/Escape/HtmlEntities.php

+<?php
+
+namespace PhpTemplate\Escape;
+
+class HtmlEntities implements EscapeInterface{
+	public function escape($value){
+		return htmlentities($value, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8');
+	}
+}