From 2d9e92a12f14de23c0db49575296a890da533583 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 9 Jul 2010 11:13:14 -0600 Subject: [PATCH] Simplify --- framework/Core/lib/Horde.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 2496172b9..e3cc7720d 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -930,11 +930,10 @@ HTML; /* Store the webroot in a local variable. */ $webroot = $registry->get('webroot'); - $url = $protocol . '://' . $server_name; - if (preg_match('|^([\w+-]{1,20})://|', $webroot)) { - /* Don't prepend to webroot if it's already absolute. */ - $url = ''; - } + /* Don't prepend to webroot if it's already absolute. */ + $url = preg_match('|^([\w+-]{1,20})://|', $webroot) + ? '' + : $protocol . '://' . $server_name; if (substr($uri, 0, 1) != '/') { /* Simple case for http:// absolute webroots. */ -- 2.11.0