diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js index 9ec8409560..4975c8e5a0 100644 --- a/phpBB/styles/prosilver/template/editor.js +++ b/phpBB/styles/prosilver/template/editor.js @@ -441,9 +441,12 @@ function getCaretPosition(txtarea) { } if (lastStart == -1) return false; - for (i = 0; i < endTags.length; i++) { - index = value.lastIndexOf(endTags[i], start); - lastEnd = Math.max(lastEnd, index); + if (start > 0) + { + for (i = 0; i < endTags.length; i++) { + index = value.lastIndexOf(endTags[i], start - 1); + lastEnd = Math.max(lastEnd, index); + } } return (lastEnd < lastStart);