From b3157cbfd859c914911b114d4edbba4654758b57 Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 17 Nov 2016 13:43:40 +0100 Subject: [PATCH] fixes #547, strong checks on url format --- include/functions.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/functions.inc.php b/include/functions.inc.php index 018747817..39b618d81 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -2055,6 +2055,16 @@ function mobile_theme() */ function url_check_format($url) { + if (strpos($url, '"') !== false) + { + return false; + } + + if (strncmp($url, 'http://', 7) !== 0 and strncmp($url, 'https://', 8) !== 0) + { + return false; + } + return filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)!==false; }