The feed links, the notification email, the webmaster address and the cookie domain now use it.
17 lines
645 B
PHP
17 lines
645 B
PHP
<?php
|
|
// Escape plain text for HTML (existing entities such as … are kept)
|
|
function h($string) {
|
|
return htmlspecialchars((string)$string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8', FALSE);
|
|
}
|
|
|
|
// Escape a raw value for an attribute or a textarea, so that it comes back unchanged
|
|
function form_value($string) {
|
|
return htmlspecialchars((string)$string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
|
}
|
|
|
|
// Text as numeric character references, which hides an email address from simple harvesters
|
|
function hidden_email($address) {
|
|
return preg_replace_callback('/./s', function ($char) { return '&#' . ord($char[0]) . ';'; }, (string)$address);
|
|
}
|
|
?>
|