summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-06-30 16:41:17 -0700
committerZach Copley <zach@controlyourself.ca>2009-06-30 16:41:17 -0700
commite36a0fd619010c1c6dbf0c1d56c20675ed78d33e (patch)
tree698fc3714805e4511f87b4f864973cbd0bacc2bf
parent203a5aba67c3bd9e2848d90b1778240b387aeda3 (diff)
parent10d4191bd103d177734ce4cf8006cd7af88e139b (diff)
Merge branch 'jeff' into 0.7.x
* jeff: Add site-wide option to change the length at which URLs are auto-shortened
-rw-r--r--README3
-rw-r--r--lib/Shorturl_api.php2
-rw-r--r--lib/common.php1
3 files changed, 5 insertions, 1 deletions
diff --git a/README b/README
index 769c416d3..679a096b3 100644
--- 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
--
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