Umherirrender has uploaded a new change for review.
https://gerrit.wikimedia.org/r/63282
Change subject: jQuery.byteLimit with callback can go into a endless loop
......................................................................
jQuery.byteLimit with callback can go into a endless loop
bug: 41450
Change-Id: Iad84522659ab160e18828cbfc463db83bc7e4795
---
M resources/jquery/jquery.byteLimit.js
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/82/63282/1
diff --git a/resources/jquery/jquery.byteLimit.js
b/resources/jquery/jquery.byteLimit.js
index f2b98f0..a8c0b06 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 {
--
To view, visit https://gerrit.wikimedia.org/r/63282
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad84522659ab160e18828cbfc463db83bc7e4795
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits