Add helper method to use implode() with HTML escaping
This commit is contained in:
@@ -24,6 +24,19 @@ class TextHelper extends Base
|
||||
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Join with HTML escaping
|
||||
*
|
||||
* @param $glue
|
||||
* @param array $list
|
||||
* @return string
|
||||
*/
|
||||
public function implode($glue, array $list)
|
||||
{
|
||||
array_walk($list, function (&$value) { $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); });
|
||||
return implode($glue, $list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Markdown transformation
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user