Skip to content

Commit 6f944dd

Browse files
committedSep 6, 2019
support: further sanitize contributor data
1 parent 9415ba0 commit 6f944dd

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed
 

‎lib/support.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,23 @@ function downloadSupportData (supportablePackages, cb) {
129129
})
130130
}
131131
contributorData.url = contributor.url
132-
done(null, contributorData)
132+
var result = {
133+
name: contributorData.name,
134+
type: contributorData.type,
135+
url: contributor.url
136+
}
137+
if (looksLikeURL(contributorData.homepage)) {
138+
result.homepage = contributorData.homepage
139+
}
140+
if (
141+
Array.isArray(contributorData.links) &&
142+
contributorData.links.every(function (element) {
143+
return looksLikeURL(element)
144+
})
145+
) {
146+
result.links = contributorData.links
147+
}
148+
done(null, result)
133149
})
134150
}
135151
}), 5, function (error, resolvedContributors) {

0 commit comments

Comments
 (0)