]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add site-wide option to change the length at which URLs are auto-shortened
authorJeff Mitchell <mitchell@kde.org>
Thu, 11 Jun 2009 13:07:41 +0000 (13:07 +0000)
committerJeff Mitchell <mitchell@kde.org>
Thu, 11 Jun 2009 13:07:41 +0000 (13:07 +0000)
README
lib/Shorturl_api.php
lib/common.php

diff --git a/README b/README
index 769c416d328e5eb27a939dd016b163eae212eb58..679a096b3bad6df536ced4c887432b3469cb90d3 100644 (file)
--- a/README
+++ b/README
@@ -901,6 +901,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
 --
index fe106cb8376a06b69ac5ba142329917b808a4427..d1fc5eb6dea23dd05c81df367cfafe1e8edd025f 100644 (file)
@@ -39,7 +39,7 @@ class ShortUrlApi
     }
 
     private function is_long($url) {
-        return strlen($url) >= 30;
+        return strlen($url) >= common_config('site', 'shorturllength');
     }
 
     protected function http_post($data) {
index 01d2c78eaa719215036d2c0cf08f3fef812ca1b9..151b31d80a53fb34e3eda35a1e250221f5c7d79a 100644 (file)
@@ -89,6 +89,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