From 10d4191bd103d177734ce4cf8006cd7af88e139b Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 11 Jun 2009 13:07:41 +0000 Subject: Add site-wide option to change the length at which URLs are auto-shortened --- lib/Shorturl_api.php | 2 +- lib/common.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Shorturl_api.php b/lib/Shorturl_api.php index fe106cb83..d1fc5eb6d 100644 --- a/lib/Shorturl_api.php +++ b/lib/Shorturl_api.php @@ -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) { diff --git a/lib/common.php b/lib/common.php index 01d2c78ea..151b31d80 100644 --- a/lib/common.php +++ b/lib/common.php @@ -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 -- cgit v1.2.3-54-g00ecf