summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-11-17 13:03:59 -0800
committerBrion Vibber <brion@pobox.com>2010-11-17 13:03:59 -0800
commit197b56778a04a1d0f12dabb84e95dc9b80902aeb (patch)
tree63f6362e82fdfd5a39fcb328afff2f16e515a66e /plugins
parent589aee587f19735d14aeb47ac0dc864d035ac97f (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 'plugins')
-rw-r--r--plugins/LinkPreview/LinkPreviewPlugin.php2
-rw-r--r--plugins/TwitterBridge/twitterimport.php8
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/LinkPreview/LinkPreviewPlugin.php b/plugins/LinkPreview/LinkPreviewPlugin.php
index da7981148..39d2c9bf3 100644
--- a/plugins/LinkPreview/LinkPreviewPlugin.php
+++ b/plugins/LinkPreview/LinkPreviewPlugin.php
@@ -50,7 +50,7 @@ class LinkPreviewPlugin extends Plugin
function onEndShowScripts($action)
{
$user = common_current_user();
- if ($user) {
+ if ($user && common_config('attachments', 'process_links')) {
$action->script('plugins/LinkPreview/linkpreview.js');
$data = json_encode(array(
'api' => common_local_url('oembedproxy'),
diff --git a/plugins/TwitterBridge/twitterimport.php b/plugins/TwitterBridge/twitterimport.php
index 498e9b1fc..9e53849d8 100644
--- a/plugins/TwitterBridge/twitterimport.php
+++ b/plugins/TwitterBridge/twitterimport.php
@@ -659,9 +659,11 @@ class TwitterImport
*/
function saveStatusAttachments($notice, $status)
{
- if (!empty($status->entities) && !empty($status->entities->urls)) {
- foreach ($status->entities->urls as $url) {
- File::processNew($url->url, $notice->id);
+ if (common_config('attachments', 'process_links')) {
+ if (!empty($status->entities) && !empty($status->entities->urls)) {
+ foreach ($status->entities->urls as $url) {
+ File::processNew($url->url, $notice->id);
+ }
}
}
}