Skip to content

Commit

Permalink
fix(devtools): remove regular expression injection
Browse files Browse the repository at this point in the history
  • Loading branch information
lavnFan committed Jan 13, 2023
1 parent 0235d18 commit 278fec1
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,10 @@ public static String camelize(String str) {
result.append(split);
continue;
}
result
.append(split.replaceFirst(split.substring(0, 1), split.substring(0, 1).toUpperCase()));
result.append(split.substring(0, 1).toUpperCase());
if (split.length() > 1) {
result.append(split.substring(1));
}
}
return result.toString();
}
Expand All @@ -434,8 +436,10 @@ public static String unCamelize(String str) {
result.append(split);
continue;
}
result.append(
split.replaceFirst(split.substring(0, 1), "-" + split.substring(0, 1).toLowerCase()));
result.append("-").append(split.substring(0, 1).toLowerCase());
if (split.length() > 1) {
result.append(split.substring(1));
}
}
return result.toString();
}
Expand Down

0 comments on commit 278fec1

Please sign in to comment.