From cff32d46c2c03621aaabac3165a5baae67f5f957 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 13 Jul 2012 23:27:00 +0200 Subject: [PATCH] facebook: Changing the order which kind of text is taken when there is no message privacy_image_cache: Workaround when a space is in the url --- facebook/facebook.php | 6 +++--- privacy_image_cache/privacy_image_cache.php | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/facebook/facebook.php b/facebook/facebook.php index 51f1fc84..b9f42859 100644 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -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)) diff --git a/privacy_image_cache/privacy_image_cache.php b/privacy_image_cache/privacy_image_cache.php index cd8a65f8..b757c783 100644 --- a/privacy_image_cache/privacy_image_cache.php +++ b/privacy_image_cache/privacy_image_cache.php @@ -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"); -- 2.39.5