disallow short hex

box-drawing
Ondřej Hruška 7 years ago
parent a9cae0e76a
commit b18a0f3890
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 2
      lang/en.php
  2. 4
      pages/cfg_term.php

@ -48,7 +48,7 @@ return [
'term.explain_scheme' => ' 'term.explain_scheme' => '
To select default text and background color, click on the To select default text and background color, click on the
preview palette. Alternatively, use numbers 0-15 for theme colors, 16-255 for standard preview palette. Alternatively, use numbers 0-15 for theme colors, 16-255 for standard
colors and hex (#FFF or #FFFFFF) for True Color (24-bit). colors and hex (#FFFFFF) for True Color (24-bit).
', ',
'term.fgbg_presets' => 'Presets', 'term.fgbg_presets' => 'Presets',

@ -299,12 +299,12 @@
var bg = $('#default_bg').val(); var bg = $('#default_bg').val();
if (/^\d+$/.test(fg)) fg = +fg; if (/^\d+$/.test(fg)) fg = +fg;
else if (!/^#[\da-f]{3,6}$/i.test(fg)) { else if (!/^#[\da-f]{6}$/i.test(fg)) {
fg = 'black'; fg = 'black';
} }
if (/^\d+$/.test(bg)) bg = +bg; if (/^\d+$/.test(bg)) bg = +bg;
else if (!/^#[\da-f]{3,6}$/i.test(bg)) { else if (!/^#[\da-f]{6}$/i.test(bg)) {
bg = 'black'; bg = 'black';
} }

Loading…
Cancel
Save