From 61586141daee2698b9998f83b386e4039d24279d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 19 Jul 2017 21:15:02 +0300 Subject: [PATCH] Fix website link on client page --- app/Libraries/Utils.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 108a077936cc..3b3267eb05fe 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -1052,20 +1052,15 @@ class Utils } } - public static function formatWebsite($website) + public static function formatWebsite($link) { - if (! $website) { + if (! $link) { return ''; } - $link = $website; - $title = $website; - $prefix = 'http://'; - - if (strlen($link) > 7 && substr($link, 0, 7) === $prefix) { - $title = substr($title, 7); - } else { - $link = $prefix.$link; + $title = $link; + if (substr($link, 0, 4) != 'http') { + $link = 'http://' . $link; } return link_to($link, $title, ['target' => '_blank']);