From 204ff4c0e79fab0d1f73daa29a026582efffee69 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 18 Dec 2018 13:22:10 +0100 Subject: rooms admin: Set a maximum character length closes #525 (Room names with more than 35 characters dispatch a team of untrained monkeys) --- includes/sys_form.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'includes/sys_form.php') diff --git a/includes/sys_form.php b/includes/sys_form.php index 38e9da4e..af8d094a 100644 --- a/includes/sys_form.php +++ b/includes/sys_form.php @@ -229,15 +229,18 @@ function form_submit($name, $label, $class = '', $wrapForm = true, $buttonType = * @param string $label * @param string $value * @param bool $disabled + * @param int $maxlength * @return string */ -function form_text($name, $label, $value, $disabled = false) +function form_text($name, $label, $value, $disabled = false, $maxlength = null) { $disabled = $disabled ? ' disabled="disabled"' : ''; + $maxlength = $maxlength ? ' maxlength=' . (int)$maxlength : ''; + return form_element( $label, '', + . '" value="' . htmlspecialchars($value) . '"' . $maxlength . $disabled . '/>', 'form_' . $name ); } -- cgit v1.2.3-70-g09d2