Fixed loop variable being used twice

This commit is contained in:
Niraj D 2017-12-22 22:09:42 -05:00 committed by GitHub
parent a1511a2e3d
commit 9e66a083ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,9 +62,9 @@ function getEmails() {
var rex = /.*?<a[^>]*href=["'](https?:\/\/[^"']+)["'][^>]*>(.*?)<\/a>.*?/gi var rex = /.*?<a[^>]*href=["'](https?:\/\/[^"']+)["'][^>]*>(.*?)<\/a>.*?/gi
while(u = rex.exec(threads[i].getMessages()[0].getBody())){ while(u = rex.exec(threads[i].getMessages()[0].getBody())){
if(u[0].toLowerCase().indexOf('unsubscribe')!==-1){ if(u[0].toLowerCase().indexOf('unsubscribe')!==-1){
for(var i = u.length-1; i >=0; i--){ for(var j = u.length-1; j >=0; j--){
if(u[i].substring(0,4)=="http"){ if(u[j].substring(0,4)=="http"){
d.uns=u[i] d.uns=u[j]
break break
} }
} }
@ -74,9 +74,6 @@ function getEmails() {
} }
} }
} }
if(d.uns === null){
Logger.log(d.subject)
}
data.push(d) data.push(d)
} else { } else {
break break