]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix for spaces in links
authorMichael Vogel <icarus@dabo.de>
Sun, 22 Feb 2015 19:06:13 +0000 (20:06 +0100)
committerMichael Vogel <icarus@dabo.de>
Sun, 22 Feb 2015 19:06:13 +0000 (20:06 +0100)
include/bbcode.php
library/markdown.php

index d461b984824fa0683464e7fe0cbad9901b359b02..1da9bf1d24b938de7e629e61a2b6469956b198c3 100644 (file)
@@ -191,7 +191,7 @@ function bb_cleanup_share($shared, $plaintext, $nolink) {
        if (isset($bookmark[1][0]))
                $link = $bookmark[1][0];
 
-       if (($title != "") AND (strpos($title, $shared[1]) !== false))
+       if (($shared[1] != "") AND (strpos($title, $shared[1]) !== false))
                $shared[1] = $title;
 
        if (($title != "") AND ((strpos($shared[1],$title) !== false) OR
index 271d2e36c68a411442ef686530146e34d0662062..83082f7ca77072a4eee47ef82bca1ccba814c1a8 100644 (file)
@@ -2,6 +2,11 @@
 require_once("library/parsedown/Parsedown.php");
 
 function Markdown($text) {
+
+       // Bugfix for the library:
+       // "[Title](http://domain.tld/ )" isn't handled correctly
+       $text = preg_replace("/\[(.*?)\]\s*?\(\s*?(\S*?)\s*?\)/ism", '[$1]($2)', $text);
+
        $Parsedown = new Parsedown();
        return($Parsedown->text($text));
 }