diff options
author | Friendika <info@friendika.com> | 2011-08-25 16:37:27 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-25 16:37:27 -0700 |
commit | 21c03fb5220d2190a8a764d5430c6fa8bc013860 (patch) | |
tree | a5739e2c79eb2564053aacf939f1b9d218cf09dc /include/bb2diaspora.php | |
parent | 1b33ba6587766d939ac37c1ca60aa5c012e4da9d (diff) | |
download | volse-hubzilla-21c03fb5220d2190a8a764d5430c6fa8bc013860.tar.gz volse-hubzilla-21c03fb5220d2190a8a764d5430c6fa8bc013860.tar.bz2 volse-hubzilla-21c03fb5220d2190a8a764d5430c6fa8bc013860.zip |
diaspora2bb, salmon fix argument error
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r-- | include/bb2diaspora.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 5ce34d666..7f7b8748d 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -5,6 +5,25 @@ require_once('include/event.php'); + +function diaspora2bb($s) { + + $s = str_replace(array('\\**','\\__','\\*','\\_'), array('-^doublestar^-','-^doublescore-^','-^star^-','-^score^-'),$s); + $s = preg_replace("/\*\*\*(.+?)\*\*\*/", '[b][i]$1[/i][/b]', $s); + $s = preg_replace("/\_\_\_(.+?)\_\_\_/", '[b][i]$1[/i][/b]', $s); + $s = preg_replace("/\*\*(.+?)\*\*/", '[b]$1[/b]', $s); + $s = preg_replace("/\_\_(.+?)\_\_/", '[b]$1[/b]', $s); + $s = preg_replace("/\*(.+?)\*/", '[i]$1[/i]', $s); + $s = preg_replace("/\_(.+?)\_/", '[i]$1[/i]', $s); + $s = str_replace(array('-^doublestar^-','-^doublescore-^','-^star^-','-^score^-'), array('**','__','*','_'), $s); + $s = preg_replace('/\[(.+?)\]\((.+?)\)/','[url=$2]$1[/url]',$s); + + $s = escape_tags($s); + return $s; + +} + + function stripdcode_br_cb($s) { return '[code]' . str_replace('<br />', '', $s[1]) . '[/code]'; } |