Files
xxx/html.lib.php
tim 5d657d7e45 Take the site address from SITE_URL.
The feed links, the notification email, the webmaster address and the cookie domain now use it.
2026-09-26 15:27:51 +02:00

17 lines
645 B
PHP

<?php
// Escape plain text for HTML (existing entities such as &hellip; 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);
}
?>