diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.php | 1 | ||||
-rw-r--r-- | lib/util.php | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/default.php b/lib/default.php index ece01f2a8..a91fa338f 100644 --- a/lib/default.php +++ b/lib/default.php @@ -253,6 +253,7 @@ $default = 'show_thumbs' => true, // show thumbnails in notice lists for uploaded images, and photos and videos linked remotely that provide oEmbed info 'thumb_width' => 100, 'thumb_height' => 75, + 'process_links' => true, // check linked resources for embeddable photos and videos; this will hit referenced external web sites when processing new messages. ), 'application' => array('desclimit' => null), 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)) { |