jquery.byteLimit: Fix infinite loop if text is longer than max
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 13 May 2013 18:34:26 +0000 (20:34 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 24 May 2013 09:26:47 +0000 (09:26 +0000)
commite7cd380dee656bfb08278116994490600bafe54f
treea427ed214282cbc9c6278b04840c84eed53e8b4c
parent4caa8528cabeac71bb0181d19e1c611afa71b7f5
jquery.byteLimit: Fix infinite loop if text is longer than max

When the length of the returned text of the callback is longer than the
max, the slicing of the input text, should not go into a endless loop.

Without this change, the added unit tests would fail as a result of
the infinite loop.

Bug: 41450
Change-Id: Iad84522659ab160e18828cbfc463db83bc7e4795
resources/jquery/jquery.byteLimit.js
tests/qunit/suites/resources/jquery/jquery.byteLimit.test.js