1
0
Fork 0

Merge pull request #408 from CyberDomovoy/diaspora

Replace spaces with undercores in tags when sending to diaspora
This commit is contained in:
friendica 2012-07-24 15:26:18 -07:00
commit d60a834906

View file

@ -2120,7 +2120,6 @@ function diaspora_unshare($me,$contact) {
} }
function diaspora_send_status($item,$owner,$contact,$public_batch = false) { function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
$a = get_app(); $a = get_app();
@ -2154,8 +2153,12 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
} }
} }
*/ */
// Removal of tags /**
$body = preg_replace('/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '#$2', $body); * Transform #tags, strip off the [url] and replace spaces with underscore
*/
$body = preg_replace_callback('/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', function($match) {
return '#'. str_replace(' ', '_', $match[2]);
}, $body);
//if(strlen($title)) //if(strlen($title))
// $body = "[b]".html_entity_decode($title)."[/b]\n\n".$body; // $body = "[b]".html_entity_decode($title)."[/b]\n\n".$body;