Closed Bug 261884 Opened 20 years ago Closed 12 years ago

Null Javascript characters show in textbox and can't use indexOf to find them.

Categories

(Core :: DOM: Core & HTML, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: barryman_5000, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20040920 Firefox/0.10 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20040920 Firefox/0.10 When appending the null string "\0\0\0\0\0\0\0\0" to a string it is supposed to make null characters. Well I can do a charCodeAt and the extra characters will have a value of 0 but I can't do an indexOf("\0\0\0\0\0\0\0\0") to find the first occurence of the null characters so that I can use a substr to remove them from showing up in the text box. Reproducible: Always Steps to Reproduce: 1.Type in some string that isn't a power of 8 @ http://pwstudios.com/des.html. 2.Press encrypt. 3.Press decrypt. Actual Results: Watch the null characters party at the end of your string! Expected Results: Well, either omit null characters or allow me to find them and remove them myself via a indexOf or something.
So there's no JS engine bug -- but where is the bug? Not in Firefox's website! /be
Need a minimal testcase. Probably DOM . /be
Assignee: bugs → general
Status: UNCONFIRMED → NEW
Component: Web Site → DOM: Level 0
Ever confirmed: true
Product: Firefox → Browser
Version: unspecified → Trunk
The JS in http://pwstudios.com/des.js has no calls to indexOf....
data:text/html,<a onclick='z()'>click me</a>%0d%0a<script>function q(a) {window.status+='\t'+a;} function z(){var a='aaa\0\0\0'; q(a.indexOf('\0\0\0')); var aa=document.getElementById('aa'); aa.value=a; q(aa.value.indexOf('\0\0\0')); }</script><form id='f'><input id='aa'> wfm personally i'd probably use .replace(/\0+$/,'') ....
Assignee: general → nobody
QA Contact: general
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: