mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix website link on client page
This commit is contained in:
parent
016c58353f
commit
61586141da
@ -1052,20 +1052,15 @@ class Utils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function formatWebsite($website)
|
public static function formatWebsite($link)
|
||||||
{
|
{
|
||||||
if (! $website) {
|
if (! $link) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = $website;
|
$title = $link;
|
||||||
$title = $website;
|
if (substr($link, 0, 4) != 'http') {
|
||||||
$prefix = 'http://';
|
$link = 'http://' . $link;
|
||||||
|
|
||||||
if (strlen($link) > 7 && substr($link, 0, 7) === $prefix) {
|
|
||||||
$title = substr($title, 7);
|
|
||||||
} else {
|
|
||||||
$link = $prefix.$link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return link_to($link, $title, ['target' => '_blank']);
|
return link_to($link, $title, ['target' => '_blank']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user