From 4cf82d52943b00c2710b7867387230a0e58225be Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 27 Jul 2011 12:49:55 -0400 Subject: Relax PPTP password restrictions, just prevent starting with a !, and limit to common printable/keyboard characters so it doesn't result in invalid xml. Fixes #1720 --- usr/local/www/vpn_pptp_users_edit.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr/local/www/vpn_pptp_users_edit.php') diff --git a/usr/local/www/vpn_pptp_users_edit.php b/usr/local/www/vpn_pptp_users_edit.php index b1b4811..7ddf348 100755 --- a/usr/local/www/vpn_pptp_users_edit.php +++ b/usr/local/www/vpn_pptp_users_edit.php @@ -84,12 +84,12 @@ if ($_POST) { if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['username'])) $input_errors[] = gettext("The username contains invalid characters."); - if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['password'])) - $input_errors[] = gettext("The password contains invalid characters."); - if (preg_match("/^!/", $_POST['password'])) $input_errors[] = gettext("The password cannot start with '!'."); + if (!preg_match("/^[\x20-\x7E]*$/", $_POST['password'])) + $input_errors[] = gettext("The password contains invalid characters."); + if (($_POST['password']) && ($_POST['password'] != $_POST['password2'])) { $input_errors[] = gettext("The passwords do not match."); } -- cgit v1.1