From e0a8ffcfb9246dc5fda840dc5386598730245802 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Mon, 12 Aug 2013 21:14:32 +1000 Subject: [PATCH] ?/config: Link URLs in comments --- inc/mod/config-editor.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/mod/config-editor.php b/inc/mod/config-editor.php index 27740378..3f15ebe5 100644 --- a/inc/mod/config-editor.php +++ b/inc/mod/config-editor.php @@ -115,8 +115,14 @@ function config_vars() { $already_exists = true; } - if (!$already_exists && permission_to_edit_config_var($var['name'])) + if (!$already_exists && permission_to_edit_config_var($var['name'])) { + foreach ($var['comment'] as &$comment) { + $comment = preg_replace_callback( + '/((?:https?:\/\/|ftp:\/\/|irc:\/\/)[^\s<>()"]+?(?:\([^\s<>()"]*?\)[^\s<>()"]*?)*)((?:\s|<|>|"|\.||\]|!|\?|,|,|")*(?:[\s<>()"]|$))/', + 'markup_url', $comment); + } $conf[] = $var; + } } }