]> 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)
committerZach Copley <zach@controlyourself.ca>
Tue, 30 Jun 2009 23:46:33 +0000 (16:46 -0700)
README
lib/Shorturl_api.php
lib/common.php

diff --git a/README b/README
index e02fa02d31bc42e21ab9296f701df4c29cce8b43..0f1b5a43b485e17445599fea76b126e96503acdb 100644 (file)
--- 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
 --
index 29f4eb3a66ff3eefbe989d9f07c51e815ac2487a..22d5b4cb5442e762b05d7a0d9a85c0944f4ad8e3 100644 (file)
@@ -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) {
index e10f24b3b8c4f47cffae7b4e13df5c3d2b7025d4..5d451463b9ed9f4e794f67bc980becf80ea60fb8 100644 (file)
@@ -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