Range check font size

This commit is contained in:
M66B 2021-04-21 07:32:56 +02:00
parent 3471750ef4
commit 9e80060dd8
1 changed files with 6 additions and 2 deletions

View File

@ -481,12 +481,16 @@ public class HtmlHelper {
if (size.startsWith("-")) {
if (s < 0)
size = "smaller";
else
throw new NumberFormatException("size=" + size);
} else if (size.startsWith("+")) {
if (s > 0)
size = "larger";
} else if (s >= 1 && s < 3)
else
throw new NumberFormatException("size=" + size);
} else if (s < 3)
size = "small";
else if (s > 3 && s <= 7)
else if (s > 3)
size = "large";
else
size = "medium";