summaryrefslogtreecommitdiff
path: root/resources/jquery/jquery.byteLimit.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/jquery/jquery.byteLimit.js')
-rw-r--r--resources/jquery/jquery.byteLimit.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/resources/jquery/jquery.byteLimit.js b/resources/jquery/jquery.byteLimit.js
index f2b98f09..a8c0b065 100644
--- a/resources/jquery/jquery.byteLimit.js
+++ b/resources/jquery/jquery.byteLimit.js
@@ -78,7 +78,8 @@
// Chop off characters from the end of the "inserted content" string
// until the limit is statisfied.
if ( fn ) {
- while ( $.byteLength( fn( inpParts.join( '' ) ) ) > byteLimit ) {
+ // stop, when there is nothing to slice - bug 41450
+ while ( $.byteLength( fn( inpParts.join( '' ) ) ) > byteLimit && inpParts[1].length > 0 ) {
inpParts[1] = inpParts[1].slice( 0, -1 );
}
} else {