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
This commit is contained in:
Michael Vogel 2012-07-13 23:27:00 +02:00
parent bf4f8f4729
commit cff32d46c2
2 changed files with 6 additions and 3 deletions

View file

@ -1090,15 +1090,15 @@ function facebook_post_hook(&$a,&$b) {
}
// Fallback - if message is empty
if(!strlen($msg))
$msg = $linkname;
if(!strlen($msg))
$msg = $link;
if(!strlen($msg))
$msg = $image;
if(!strlen($msg))
$msg = $linkname;
// If there is nothing to post then exit
if(!strlen($msg))
return;

View 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");