https://bugzilla.wikimedia.org/show_bug.cgi?id=29804

       Web browser: ---
             Bug #: 29804
           Summary: jquery.byteLimit should allow the limit to be reached
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: Unprioritized
         Component: Javascript
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
            Blocks: 29097
    Classification: Unclassified


See also https://bugzilla.wikimedia.org/show_bug.cgi?id=28650 and r86698 in
which this module was created.

r91844 added a test suite exposed a bug.

jquery.byteLimit is preventing characters to be added as soon as
byteLength(currentValue) + 3 is more than the given limit.

Consider the following scenarios:

byteLimit: 10
input: "123456890123456890" (20 chars, 20 bytes)
result: 8 chars
expected: 10 chars ("1234567890")

The last 2 characters were incorrectly prevented from insertion.


byteLimit: 14
input: "1234567890€1234567890€" (22 chars, 26 bytes; contains two euro-symbols
of 3 bytes each)
result: 13 chars
expected: 14 ("1234567890" + "€" + 1)

The last one was incorrectly prevented.


byteLimit: 12
input: "1234567890€1234567890€"
result: 10 chars
expected: 10 ("1234567890". as the next 3-byte "€" would exceed the limit)

This third scenario is the only one correctly passing.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to