dl/includes/HTMLTools.php
2020-06-17 20:49:28 +02:00

25 lines
No EOL
504 B
PHP

<?php
class HTMLTools {
private static $invisibleSpace = '<span class="invisiblespace"> </span>';
public static function makeSafe ($string) {
return htmlentities($string);
}
public static function makeSafeAndWrapBetter ($string) {
return preg_replace(
array('~/|-|\.~'),
array(static::$invisibleSpace.'$0'.static::$invisibleSpace), // Put an invisible space before and after each slash, hyphen and period
static::makeSafe($string)
);
}
}
?>