From: Jeff Mitchell Date: Thu, 11 Jun 2009 13:07:41 +0000 (+0000) Subject: Add site-wide option to change the length at which URLs are auto-shortened X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b416df93128e6ffc42ad62233f92ab617f809de1;p=quix0rs-gnu-social.git Add site-wide option to change the length at which URLs are auto-shortened --- diff --git a/README b/README index e02fa02d31..0f1b5a43b4 100644 --- a/README +++ b/README @@ -906,6 +906,9 @@ sslserver: use an alternate server name for SSL URLs, like parameters correctly so that both the SSL server and the "normal" server can access the session cookie and preferably other cookies as well. +shorturllength: Length of URL at which URLs in a message exceeding 140 + characters will be sent to the user's chosen + shortening service. db -- diff --git a/lib/Shorturl_api.php b/lib/Shorturl_api.php index 29f4eb3a66..22d5b4cb54 100644 --- a/lib/Shorturl_api.php +++ b/lib/Shorturl_api.php @@ -40,7 +40,7 @@ class ShortUrlApi } private function is_long($url) { - return strlen($url) >= $this->long_limit; + return strlen($url) >= common_config('site', 'shorturllength'); } protected function http_post($data) { diff --git a/lib/common.php b/lib/common.php index e10f24b3b8..5d451463b9 100644 --- a/lib/common.php +++ b/lib/common.php @@ -120,6 +120,7 @@ $config = 'private' => false, 'ssl' => 'never', 'sslserver' => null, + 'shorturllength' => 30, 'dupelimit' => 60), # default for same person saying the same thing 'syslog' => array('appname' => 'laconica', # for syslog