зеркало из https://github.com/mozilla/pjs.git
Bug #298624 --> redeclaration of constant kMailToLength in nsContextMenu.js
Patch by Henrik Skupin <hskupin@gmail.com>
This commit is contained in:
Родитель
6ec1f3c69c
Коммит
d0c4a7015c
|
@ -49,7 +49,6 @@
|
||||||
| longer term, this code will be restructured to make it more reusable. |
|
| longer term, this code will be restructured to make it more reusable. |
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
const kMailToLength = 7;
|
|
||||||
|
|
||||||
function nsContextMenu( xulMenu ) {
|
function nsContextMenu( xulMenu ) {
|
||||||
this.target = null;
|
this.target = null;
|
||||||
|
@ -572,14 +571,17 @@ nsContextMenu.prototype = {
|
||||||
// Copy the comma-separated list of email addresses only.
|
// Copy the comma-separated list of email addresses only.
|
||||||
// There are other ways of embedding email addresses in a mailto:
|
// There are other ways of embedding email addresses in a mailto:
|
||||||
// link, but such complex parsing is beyond us.
|
// link, but such complex parsing is beyond us.
|
||||||
|
|
||||||
|
const kMailToLength = 7; // length of "mailto:"
|
||||||
|
|
||||||
var url = this.linkURL();
|
var url = this.linkURL();
|
||||||
var qmark = url.indexOf( "?" );
|
var qmark = url.indexOf( "?" );
|
||||||
var addresses;
|
var addresses;
|
||||||
|
|
||||||
if ( qmark > 7 ) { // 7 == length of "mailto:"
|
if ( qmark > kMailToLength ) {
|
||||||
addresses = url.substring( 7, qmark );
|
addresses = url.substring( kMailToLength, qmark );
|
||||||
} else {
|
} else {
|
||||||
addresses = url.substr( 7 );
|
addresses = url.substr( kMailToLength );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let's try to unescape it using a character set
|
// Let's try to unescape it using a character set
|
||||||
|
|
Загрузка…
Ссылка в новой задаче