Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stray non-ASCII characters in app.js caused by commit 1cb97c7efd #8894

Closed
rotdrop opened this issue Jan 28, 2023 · 2 comments
Closed

Stray non-ASCII characters in app.js caused by commit 1cb97c7efd #8894

rotdrop opened this issue Jan 28, 2023 · 2 comments

Comments

@rotdrop
Copy link

rotdrop commented Jan 28, 2023

if (!container.length || !identity_email || !this.mailvelope_keyring.createKeyGenContainer)

The commit 1cb97c7 introduced control characters (UTF-8 non-breaking space) which cause at least Firefox's scripting engine to fail if it hits this line. I got the error in the Firefox dev-console:

18:21:01.399 Uncaught Syntax Error: missing ) after condition app.js:4245:30

The error vanishes if the UTF-8 space is removed.

You can see this by either

  • git blame:
$ > git blame program/js/app.js|grep 4245|hexdump -c
0000000   1   c   b   9   7   c   7   e   f   d       (   T   h   o   m
0000010   a   s       B   r   u   e   d   e   r   l   i                
0000020   2   0   1   8   -   0   1   -   2   1       1   2   :   1   4
0000030   :   3   3       +   0   1   0   0           4   2   4   5   )
0000040                       i   f       (   !   c   o   n   t   a   i
0000050   n   e   r   .   l   e   n   g   t   h       |   | 302 240   !
0000060   i   d   e   n   t   i   t   y   _   e   m   a   i   l       |
0000070   |       !   t   h   i   s   .   m   a   i   l   v   e   l   o
0000080   p   e   _   k   e   y   r   i   n   g   .   c   r   e   a   t
0000090   e   K   e   y   G   e   n   C   o   n   t   a   i   n   e   r
00000a0   )  \n                                                        
00000a2

Of course, just checking the file out and "looking at it" will also reveal. You can also navigate in Github to this line, activate the ...-menu and copy the line and then run it through hexdump or your favourite hex-tool:

echo 'if (!container.length || !identity_email || !this.mailvelope_keyring.createKeyGenContainer)' | hexdump -c
0000000   i   f       (   !   c   o   n   t   a   i   n   e   r   .   l
0000010   e   n   g   t   h       |   | 302 240   !   i   d   e   n   t
@alecpl
Copy link
Member

alecpl commented Jan 28, 2023

Indeed, we should fix this. But this is there since 1.4 and no one noticed.

@alecpl
Copy link
Member

alecpl commented Jan 28, 2023

Fixed.

@alecpl alecpl closed this as completed Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants