Make links in settings desc clickable

This commit is contained in:
slawkens
2023-11-11 21:16:34 +01:00
parent 1d5b751fe1
commit f008591580
2 changed files with 5 additions and 1 deletions

View File

@@ -1675,6 +1675,10 @@ function displayErrorBoxWithBackButton($errors, $action = null) {
]);
}
function makeLinksClickable($text, $blank = true) {
return preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href="$1"' . (!$blank ?: ' target="_blank"') . '>$1</a>', $text);
}
// validator functions
require_once LIBS . 'validator.php';
require_once SYSTEM . 'compat/base.php';