From caa85a68501aa90c5bdda563911483b541542fda Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 7 Jul 2003 10:36:41 +0000 Subject: [PATCH] fixed checking of samba paths --- lam/templates/profedit/profilecreate.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lam/templates/profedit/profilecreate.php b/lam/templates/profedit/profilecreate.php index 25b0ddc4..53c5cf5a 100644 --- a/lam/templates/profedit/profilecreate.php +++ b/lam/templates/profedit/profilecreate.php @@ -193,7 +193,9 @@ if ($_GET['type'] == "user") { echo ("

" . _("Back to Profile Editor") . ""); exit; } - if ($_POST['smb_smbhome'] && eregi("^[/]([a-z0-9])+([/][a-z0-9_\\-\\$]+)*$", $_POST['smb_smbhome'])) { + // replace double \'s with \ + $_POST['smb_smbhome'] = str_replace('\\\\', '\\', $_POST['smb_smbhome']); + if ($_POST['smb_smbhome'] && eregi("^[\][\]([a-z0-9])+([\][a-z0-9_\\-\\$%]+)+$", $_POST['smb_smbhome'])) { $acct->smb_smbhome = $_POST['smb_smbhome']; } elseif ($_POST['smb_smbhome']) { @@ -201,7 +203,9 @@ if ($_GET['type'] == "user") { echo ("

" . _("Back to Profile Editor") . ""); exit; } - if ($_POST['smb_profilepath'] && eregi("^[/]([a-z0-9])+([/][a-z0-9_\\-\\$]+)*$", $_POST['smb_profilepath'])) { + // replace double \'s with \ + $_POST['smb_profilepath'] = str_replace('\\\\', '\\', $_POST['smb_profilepath']); + if ($_POST['smb_profilepath'] && eregi("^[\][\]([a-z0-9])+([\][a-z0-9_\\-\\$%]+)+$", $_POST['smb_profilepath'])) { $acct->smb_profilePath = $_POST['smb_profilepath']; } elseif ($_POST['smb_profilepath']) { @@ -209,7 +213,9 @@ if ($_GET['type'] == "user") { echo ("

" . _("Back to Profile Editor") . ""); exit; } - if ($_POST['smb_scriptPath'] && eregi("^[/]([a-z0-9])+([/][a-z0-9_\\-\\$]+)*$", $_POST['smb_scriptPath'])) { + // replace double \'s with \ + $_POST['smb_scriptPath'] = str_replace('\\\\', '\\', $_POST['smb_scriptPath']); + if ($_POST['smb_scriptPath'] && eregi("^[\][\]([a-z0-9])+([\][a-z0-9_\\-\\$%.]+)+$", $_POST['smb_scriptPath'])) { $acct->smb_scriptPath = $_POST['smb_scriptPath']; } elseif ($_POST['smb_scriptPath']) {