aboutsummaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-04-28 04:44:17 -0700
committerFriendika <info@friendika.com>2011-04-28 04:44:17 -0700
commit0ac4d6ecc97baf3a8b40e411d2e57e9908667675 (patch)
tree23e5c883f8160f3f4e3e1ada0a18818eaaa3abc3 /addon
parent38cb0a329527a07ab82c812001d22eae572d6f82 (diff)
downloadvolse-hubzilla-0ac4d6ecc97baf3a8b40e411d2e57e9908667675.tar.gz
volse-hubzilla-0ac4d6ecc97baf3a8b40e411d2e57e9908667675.tar.bz2
volse-hubzilla-0ac4d6ecc97baf3a8b40e411d2e57e9908667675.zip
provide a test mode for facebook posts which goes through the motions but doesn't actually post content
Diffstat (limited to 'addon')
-rw-r--r--addon/facebook/facebook.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php
index 26ec8c597..c7821b272 100644
--- a/addon/facebook/facebook.php
+++ b/addon/facebook/facebook.php
@@ -444,7 +444,7 @@ function facebook_post_hook(&$a,&$b) {
$msg = preg_replace("/\[url=(.+?)\](.+?)\[\/url\]/is",'$2 $1',$msg);
- $msg = preg_replace("/\[img\](.+?)\[\/img\]/is", t('Image: ') . '$1',$msg);
+ $msg = preg_replace("/\[img\](.+?)\[\/img\]/is", t('Image: ') . '$1', $msg);
$msg = trim(strip_tags(bbcode($msg)));
$msg = html_entity_decode($msg,ENT_QUOTES,'UTF-8');
@@ -504,7 +504,11 @@ function facebook_post_hook(&$a,&$b) {
logger('facebook: post to ' . $url);
logger('facebook: postvars: ' . print_r($postvars,true));
- $x = post_url($url, $postvars);
+ // "test_mode" prevents anything from actually being posted.
+ // Otherwise, let's do it.
+
+ if(! get_config('facebook','test_mode'))
+ $x = post_url($url, $postvars);
$retj = json_decode($x);
if($retj->id) {