Skip to content

Commit 4bf7610

Browse files
author
Raymond Benc
committed
fix #631
1 parent 0a6c7bf commit 4bf7610

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

PF.Base/include/library/phpfox/parse/output.class.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,20 @@ public function replaceHashTags($sTxt)
216216
$sTxt = preg_replace_callback("/(&#+[0-9+]+;)/", array($this, '_replaceUnicode'), $sTxt);
217217
// http://www.phpfox.com/tracker/view/14956/
218218
$sTxt = preg_replace_callback("/(\-?color:)\s*#([A-F0-9]{3,6})/i", array($this, '_replaceHexColor'), $sTxt);
219-
$sTxt = preg_replace_callback("/(#[\wa-zA-Z0-9\[\]\/]+)/u", array($this, '_replaceHashTags'), $sTxt);
219+
// $sTxt = preg_replace_callback("/(#[\wa-zA-Z0-9\[\]\/]+)/u", array($this, '_replaceHashTags'), $sTxt);
220+
220221
$sTxt = preg_replace('/\[UNICODE\]([0-9]+)\[\/UNICODE\]/', '&#\\1;', $sTxt);
221222

222-
return $sTxt;
223+
$sReturn = '';
224+
$aParts = explode(' ', ' ' . $sTxt);
225+
foreach ($aParts as $sPart) {
226+
if (substr($sPart, 0, 1) == '#') {
227+
$sPart = $this->_replaceHashTags([$sPart, $sPart]);
228+
}
229+
$sReturn .= $sPart . ' ';
230+
}
231+
232+
return trim($sReturn);
223233
}
224234

225235
public function getHashTags($sTxt)

0 commit comments

Comments
 (0)