From 0d7c91fc10e0d32171459bdde2f1d829f9306624 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 12 Jan 2014 09:16:46 +0100 Subject: [PATCH 1/2] added a check for http in homepage url, this should fix issue #768 --- mod/profiles.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/profiles.php b/mod/profiles.php index 148c63291..ad1f9a351 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -288,6 +288,10 @@ function profiles_post(&$a) { $sexual = notags(trim($_POST['sexual'])); $homepage = notags(trim($_POST['homepage'])); + if (strpos($homepage, 'http') === false) { + // neither http nor https in URL, add them + $homepage = 'http://'.$homepage; + } $hometown = notags(trim($_POST['hometown'])); $politic = notags(trim($_POST['politic'])); $religion = notags(trim($_POST['religion'])); From fda7bdca2eb7666c9c04b45f0c5952e87a045e2c Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Mon, 13 Jan 2014 14:25:50 +0100 Subject: [PATCH 2/2] better logic --- mod/profiles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/profiles.php b/mod/profiles.php index ad1f9a351..65c329af1 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -288,7 +288,7 @@ function profiles_post(&$a) { $sexual = notags(trim($_POST['sexual'])); $homepage = notags(trim($_POST['homepage'])); - if (strpos($homepage, 'http') === false) { + if (strpos($homepage, 'http') !== 0) { // neither http nor https in URL, add them $homepage = 'http://'.$homepage; }