X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Futil.php;h=99be56daeb3981a211abf683411975cf0a36e00b;hb=ba4bda9beb8b51eb53c47ac32e435179cb9eecde;hp=49764f86a5fe40cc32effaa60a75fb682547202c;hpb=11f2a3d551d39732d44495751eaf4643c9fd8c90;p=quix0rs-gnu-social.git diff --git a/lib/util.php b/lib/util.php index 49764f86a5..99be56daeb 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1459,6 +1459,7 @@ function common_redirect($url, $code=307) header('HTTP/1.1 '.$code.' '.$status[$code]); header("Location: $url"); + header("Connection: close"); $xo = new XMLOutputter(); $xo->startXML('a', @@ -2162,7 +2163,11 @@ function common_shorten_url($long_url, User $user=null, $force = false) } else { $shortenedUrl = common_local_url('redirecturl', array('id' => $f->id)); - return $shortenedUrl; + if ((mb_strlen($shortenedUrl) < mb_strlen($long_url)) || $force) { + return $shortenedUrl; + } else { + return $long_url; + } } } else { return $long_url;