Skip to content

Commit

Permalink
fix editor smiley conversion at start and end of plaintext; updates #…
Browse files Browse the repository at this point in the history
…1103
  • Loading branch information
following5 committed Aug 30, 2017
1 parent e10e9b5 commit 22a35fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions htdocs/lib2/edithelper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ function processEditorInput($oldDescMode, $descMode, $text, &$representText)
// mode switch from plain text to HTML editor => convert HTML special chars
$text = nl2br(htmlspecialchars($text));
// .. and smilies
$text = ' ' . $text . ' '; // see Redmine #1103
$text = str_replace($smiley['text'], $smiley['spaced_image'], $text);
if (substr($text, 0, 1) == ' ') {
$text = substr($text, 1);
}
if (substr($text, -1) == ' ') {
$text = substr($text, 0, strlen($text) - 1);
}
$representText = $text;
} else {
// save HTML input => verify / tidy / filter;
Expand Down

0 comments on commit 22a35fa

Please sign in to comment.