'javascript:' is case-insensitive; change for nsContextMenu.isLinkSaveable(link)

VERIFIED FIXED

Status

P3
normal
VERIFIED FIXED
19 years ago
14 years ago

People

(Reporter: jrgmorrison, Assigned: law)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

19 years ago
Here's an amendment to the fix to bug #23690, with earth-shattering
consequences (not)!

Per bug #41718, protocol schemes are not case-sensitive, so the test
for 'javascript:' in nsContextMenu.isLinkSaveable(link) should be
modified to do a case-insensitive comparison for 'JaVaScRipT:'.


> diff -u nsContextMenu.js~ nsContextMenu.js
--- nsContextMenu.js~   Thu Jun 01 20:13:36 2000
+++ nsContextMenu.js    Tue Jun 06 15:42:42 2000
@@ -262,10 +262,10 @@
            // We must resort to testing the URL string :-(.
            dump( "Bug! Link.protocol is still undefined!\n" );
            var protocol = link.href.substr( 0, 11 );
-           return protocol != "javascript:";
+           return protocol.toLowerCase() != "javascript:";
         } else {
            // Presume all but javascript: urls are saveable.
-           return link.protocol != "javascript:";
+           return link.protocol.toLowerCase() != "javascript:";
         }
     },
     // Open linked-to URL in a new window.

Comment 1

18 years ago
nav triage team:

Not a beta1 stopper, marking nsbeta1-
Keywords: nsbeta1-
(Assignee)

Comment 2

18 years ago
Too late, Paul :-).  Somebody checked in the fix, already.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Reporter)

Comment 3

18 years ago
Yep. Heikki, it seems.
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.