|
|
|
@ -544,9 +544,9 @@ public class ApplicationManagementUtil {
|
|
|
|
|
* @return Sanitized and shortened file name
|
|
|
|
|
*/
|
|
|
|
|
public static String sanitizeName(String originalName, String type) {
|
|
|
|
|
String sanitizedName = originalName.replaceAll("[^a-zA-Z0-9.\\s-]", "");
|
|
|
|
|
if (type.equals(Constants.ApplicationProperties.NAME) && sanitizedName.length() > 350) {
|
|
|
|
|
sanitizedName = sanitizedName.substring(0, 350);
|
|
|
|
|
String sanitizedName = originalName.replaceAll(Constants.APP_NAME_REGEX, "");
|
|
|
|
|
if (Constants.ApplicationProperties.NAME.equals(type) && sanitizedName.length() > Constants.MAX_APP_NAME_CHARACTERS) {
|
|
|
|
|
sanitizedName = sanitizedName.substring(0, Constants.MAX_APP_NAME_CHARACTERS);
|
|
|
|
|
return sanitizedName;
|
|
|
|
|
} else if (Constants.ICON_NAME.equals(type) || Constants.SCREENSHOT_NAME.equals(type)) {
|
|
|
|
|
// Shortening icon/screenshot names
|
|
|
|
@ -556,7 +556,8 @@ public class ApplicationManagementUtil {
|
|
|
|
|
fileExtension = originalName.substring(dotIndex);
|
|
|
|
|
}
|
|
|
|
|
return type + fileExtension;
|
|
|
|
|
} else
|
|
|
|
|
} else {
|
|
|
|
|
return sanitizedName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|