mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
Bug 345319: installation of an engine with a very long name can fail, original patch by Joey Minta <jminta@gmail.com>, r=mconnor
This commit is contained in:
parent
91dcbae45b
commit
88413cff00
@ -665,6 +665,7 @@ function getSanitizedFile(aName) {
|
||||
*/
|
||||
function sanitizeName(aName) {
|
||||
const chars = "-abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
const maxLength = 60;
|
||||
|
||||
var name = aName.toLowerCase();
|
||||
name = name.replace(/ /g, "-");
|
||||
@ -679,6 +680,9 @@ function sanitizeName(aName) {
|
||||
name += chars.charAt(Math.round(Math.random() * cl));
|
||||
}
|
||||
|
||||
if (name.length > maxLength)
|
||||
name = name.substring(0, maxLength);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user