diff options
author | Brion Vibber <brion@pobox.com> | 2010-11-17 13:03:59 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-11-17 13:03:59 -0800 |
commit | 197b56778a04a1d0f12dabb84e95dc9b80902aeb (patch) | |
tree | 63f6362e82fdfd5a39fcb328afff2f16e515a66e /lib/util.php | |
parent | 589aee587f19735d14aeb47ac0dc864d035ac97f (diff) |
Add $config['attachments']['process_links'] to allow disabling processing of mentioned URL links for attachment info (oEmbed lookups) and dereferencing of redirects that we didn't have shortened ourselves.
This option may be useful for intranet sites that don't have direct access to the internet, as they may be unable to successfully fetch those resources.
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php index e6b62f750..49566c4d4 100644 --- a/lib/util.php +++ b/lib/util.php @@ -848,7 +848,7 @@ function common_linkify($url) { $canon = File_redirection::_canonUrl($url); - $longurl_data = File_redirection::where($canon); + $longurl_data = File_redirection::where($canon, common_config('attachments', 'process_links')); if (is_array($longurl_data)) { $longurl = $longurl_data['url']; } elseif (is_string($longurl_data)) { @@ -872,8 +872,10 @@ function common_linkify($url) { $f = File::staticGet('url', $longurl); if (empty($f)) { - // XXX: this writes to the database. :< - $f = File::processNew($longurl); + if (common_config('attachments', 'process_links')) { + // XXX: this writes to the database. :< + $f = File::processNew($longurl); + } } if (!empty($f)) { |