mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-05 18:32:30 +01:00
code review
This commit is contained in:
parent
2aadc2a969
commit
30039ff9c7
@ -429,7 +429,10 @@ var getRepoMetadata = function(callback) {
|
||||
) {
|
||||
entry.repoChecksum = entry.localChecksum;
|
||||
}
|
||||
// New entry in remote repo.
|
||||
if ( entry.repoChecksum !== '' || entry.localChecksum === '' ) {
|
||||
entry.localChecksum = 'd41d8cd98f00b204e9800998ecf8427e';
|
||||
checksumsChanged = true;
|
||||
continue;
|
||||
}
|
||||
checksumsChanged = true;
|
||||
|
@ -95,17 +95,14 @@ var isIPAddress = function(hostname) {
|
||||
/******************************************************************************/
|
||||
|
||||
var toBroaderHostname = function(hostname) {
|
||||
if ( hostname === '*' ) {
|
||||
return '';
|
||||
}
|
||||
if ( isIPAddress(hostname) ) {
|
||||
return '*';
|
||||
}
|
||||
var pos = hostname.indexOf('.');
|
||||
if ( pos === -1 ) {
|
||||
return '*';
|
||||
if ( pos !== -1 ) {
|
||||
return hostname.slice(pos + 1);
|
||||
}
|
||||
return hostname.slice(pos + 1);
|
||||
return hostname !== '*' && hostname !== '' ? '*' : '';
|
||||
};
|
||||
|
||||
Matrix.toBroaderHostname = toBroaderHostname;
|
||||
|
@ -86,17 +86,14 @@ var isIPAddress = function(hostname) {
|
||||
/******************************************************************************/
|
||||
|
||||
var toBroaderHostname = function(hostname) {
|
||||
if ( hostname === '*' ) {
|
||||
return '';
|
||||
}
|
||||
if ( isIPAddress(hostname) ) {
|
||||
return '*';
|
||||
}
|
||||
var pos = hostname.indexOf('.');
|
||||
if ( pos === -1 ) {
|
||||
return '*';
|
||||
if ( pos !== -1 ) {
|
||||
return hostname.slice(pos + 1);
|
||||
}
|
||||
return hostname.slice(pos + 1);
|
||||
return hostname !== '*' && hostname !== '' ? '*' : '';
|
||||
};
|
||||
|
||||
HnSwitches.toBroaderHostname = toBroaderHostname;
|
||||
|
@ -30,14 +30,11 @@
|
||||
/******************************************************************************/
|
||||
|
||||
var toBroaderHostname = function(hostname) {
|
||||
if ( hostname === '*' ) {
|
||||
return '';
|
||||
}
|
||||
var pos = hostname.indexOf('.');
|
||||
if ( pos === -1 ) {
|
||||
return '*';
|
||||
if ( pos !== -1 ) {
|
||||
return hostname.slice(pos + 1);
|
||||
}
|
||||
return hostname.slice(pos + 1);
|
||||
return hostname !== '*' && hostname !== '' ? '*' : '';
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
@ -79,10 +76,10 @@ RedirectEngine.prototype.lookup = function(context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
src = toBroaderHostname(src);
|
||||
if ( src === '' ) {
|
||||
break;
|
||||
src = toBroaderHostname(src);
|
||||
if ( src === '' ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
des = toBroaderHostname(des);
|
||||
|
Loading…
Reference in New Issue
Block a user