]> git.mxchange.org Git - friendica-addons.git/commitdiff
facebook: Changing the order which kind of text is taken when there is no message
authorMichael Vogel <icarus@dabo.de>
Fri, 13 Jul 2012 21:27:00 +0000 (23:27 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 13 Jul 2012 21:27:00 +0000 (23:27 +0200)
privacy_image_cache: Workaround when a space is in the url

facebook/facebook.php
privacy_image_cache/privacy_image_cache.php

index 51f1fc846c424bd244230144c5ca10aca608e335..b9f4285957a6039e4b6732cd1c5d6c1c0545c0a5 100644 (file)
@@ -1091,13 +1091,13 @@ function facebook_post_hook(&$a,&$b) {
 
                                // Fallback - if message is empty
                                if(!strlen($msg))
-                                       $msg = $link;
+                                       $msg = $linkname;
 
                                if(!strlen($msg))
-                                       $msg = $image;
+                                       $msg = $link;
 
                                if(!strlen($msg))
-                                       $msg = $linkname;
+                                       $msg = $image;
 
                                // If there is nothing to post then exit
                                if(!strlen($msg))
index cd8a65f8b6c739c4d2b85453a8225d7915f98ee0..b757c7834749ef5dbdb888bda58b8481ea9f97c1 100644 (file)
@@ -51,6 +51,9 @@ function privacy_image_cache_init() {
        } else {
                require_once("Photo.php");
 
+               // It shouldn't happen but it does - spaces in URL
+               $_REQUEST['url'] = str_replace(" ", "+", $_REQUEST['url']);
+
                $img_str = fetch_url($_REQUEST['url'],true);
 
                $tempfile = tempnam("", "cache");