From 640f0d3683e98a937fd3dadf68584b5395981d59 Mon Sep 17 00:00:00 2001 From: e107steved Date: Sun, 27 Feb 2011 13:47:02 +0000 Subject: [PATCH] Bugtracker #5135, #5170 possible fix - correct URL encoding in DB --- e107_plugins/banner/admin_banner.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/e107_plugins/banner/admin_banner.php b/e107_plugins/banner/admin_banner.php index 7347cb8de..d3b8be4b6 100644 --- a/e107_plugins/banner/admin_banner.php +++ b/e107_plugins/banner/admin_banner.php @@ -106,7 +106,24 @@ if ($_POST['createbanner'] || $_POST['updatebanner']) $cLogin = $e107->tp->toDB($_POST['client_login']); $cPassword = $e107->tp->toDB($_POST['client_password']); $banImage = $e107->tp->toDB($_POST['banner_image']); + $banURL = $e107->tp->toDB($_POST['click_url']); + if (strpos($banURL, '://' ) !== FALSE) + { + $clickBits = explode('://', $banURL, 2); + if (($clickBits[0] == 'http') || ($clickBits[0] == 'https')) + { + $banURL = $clickBits[0].'://'.rawurlencode($clickBits[1]); + } + else + { + $banURL = rawurlencode($banURL); + } + } + else + { + $banURL = rawurlencode($banURL); + } if ($_POST['banner_pages']) { // Section redundant?