Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/browser/default/frmupload.html
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/browser/default/frmupload.html	(revision 291)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/browser/default/frmupload.html	(revision 292)
@@ -24,4 +24,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 	<head>
+		<title>File Upload</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
 		<link href="browser.css" type="text/css" rel="stylesheet" />
 		<script type="text/javascript" src="js/common.js"></script>
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/commands.asp
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/commands.asp	(revision 291)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/commands.asp	(revision 292)
@@ -97,4 +97,5 @@
 	Dim sNewFolderName
 	sNewFolderName = Request.QueryString( "NewFolderName" )
+	sNewFolderName = SanitizeFolderName( sNewFolderName )
 
 	If ( sNewFolderName = "" OR InStr( 1, sNewFolderName, ".." ) > 0  ) Then
@@ -103,5 +104,5 @@
 		' Map the virtual path to the local server path of the current folder.
 		Dim sServerDir
-		sServerDir = ServerMapFolder( resourceType, currentFolder & "/" & sNewFolderName )
+		sServerDir = ServerMapFolder( resourceType, CombinePaths(currentFolder, sNewFolderName) )
 
 		On Error Resume Next
@@ -162,4 +163,5 @@
 			sFileName	= oUploader.File( "NewFile" ).Name
 			sExtension	= oUploader.File( "NewFile" ).Ext
+			sFileName = SanitizeFileName( sFileName )
 			sOriginalFileName = sFileName
 
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/config.asp
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/config.asp	(revision 291)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/config.asp	(revision 292)
@@ -31,10 +31,15 @@
 ConfigIsEnabled = true
 
+' Due to security issues with Apache modules, it is reccomended to leave the
+' following setting enabled.
+Dim ConfigForceSingleExtension
+ConfigForceSingleExtension = true 
+
 ' What the user can do with this connector
-dim ConfigAllowedCommands
+Dim ConfigAllowedCommands
 ConfigAllowedCommands = "FileUpload|GetFolders|GetFoldersAndFiles|CreateFolder"
 
 ' Allowed Resource Types
-dim ConfigAllowedTypes
+Dim ConfigAllowedTypes
 ConfigAllowedTypes = "File|Image|Flash|Media"
 
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/io.asp
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/io.asp	(revision 291)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/asp/io.asp	(revision 292)
@@ -157,4 +157,35 @@
 end function
 
+' Do a cleanup of the folder name to avoid possible problems
+function SanitizeFolderName( sNewFolderName )
+	Dim oRegex
+	Set oRegex = New RegExp
+	oRegex.Global		= True
+
+' remove . \ / | : ? *
+	oRegex.Pattern = "(\.|\\|\/|\||:|\?|\*)"
+	SanitizeFolderName = oRegex.Replace( sNewFolderName, "_" )
+
+	Set oRegex = Nothing
+end function
+
+' Do a cleanup of the file name to avoid possible problems
+function SanitizeFileName( sNewFileName )
+	Dim oRegex
+	Set oRegex = New RegExp
+	oRegex.Global		= True
+
+	if ( ConfigForceSingleExtension = True ) then
+		oRegex.Pattern = "\.(?![^.]*$)"
+		sNewFileName = oRegex.Replace( sNewFileName, "_" )
+	end if
+
+' remove \ / | : ? *
+	oRegex.Pattern = "(\\|\/|\||:|\?|\*)"
+	SanitizeFileName = oRegex.Replace( sNewFileName, "_" )
+
+	Set oRegex = Nothing
+end function
+
 ' This is the function that sends the results of the uploading process.
 Sub SendUploadResults( errorNumber, fileUrl, fileName, customMsg )
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/commands.php
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/commands.php	(revision 291)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/commands.php	(revision 292)
@@ -110,4 +110,5 @@
 	{
 		$sNewFolderName = $_GET['NewFolderName'] ;
+		$sNewFolderName = SanitizeFolderName( $sNewFolderName ) ;
 
 		if ( strpos( $sNewFolderName, '..' ) !== FALSE )
@@ -165,8 +166,5 @@
 		// Get the uploaded file name.
 		$sFileName = $oFile['name'] ;
-
-		// Replace dots in the name with underscores (only one dot can be there... security issue).
-		if ( $Config['ForceSingleExtension'] )
-			$sFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sFileName ) ;
+		$sFileName = SanitizeFileName( $sFileName ) ;
 
 		$sOriginalFileName = $sFileName ;
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php	(revision 291)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/php/io.php	(revision 292)
@@ -181,4 +181,33 @@
 }
 
+// Do a cleanup of the folder name to avoid possible problems
+function SanitizeFolderName( $sNewFolderName )
+{
+	$sNewFolderName = stripslashes( $sNewFolderName ) ;
+
+	// Remove . \ / | : ? *
+//	$sNewFolderName = preg_replace( '(\.|\\|\/|\||:|\?|\*)', '_', $sNewFolderName ) ;
+	$sNewFolderName = preg_replace( '/\\.|\\\\|\\/|\\||\\:|\\?|\\*/', '_', $sNewFolderName ) ;
+
+	return $sNewFolderName ;
+}
+
+// Do a cleanup of the file name to avoid possible problems
+function SanitizeFileName( $sNewFileName )
+{
+	global $Config ;
+
+	$sNewFileName = stripslashes( $sNewFileName ) ;
+
+	// Replace dots in the name with underscores (only one dot can be there... security issue).
+	if ( $Config['ForceSingleExtension'] )
+		$sNewFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sNewFileName ) ;
+
+	// Remove \ / | : ? *
+	$sNewFileName = preg_replace( '/\\\\|\\/|\\||\\:|\\?|\\*/', '_', $sNewFileName ) ;
+
+	return $sNewFileName ;
+}
+
 // This is the function that sends the results of the uploading process.
 function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' )
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/test.html
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/test.html	(revision 291)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/test.html	(revision 292)
@@ -33,5 +33,5 @@
 		'?Command=' + command +
 		'&Type=' + document.getElementById('cmbType').value +
-		'&CurrentFolder=' + document.getElementById('txtFolder').value ;
+		'&CurrentFolder=' + encodeURIComponent(document.getElementById('txtFolder').value) ;
 
 	return sUrl ;
Index: /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/uploadtest.html
===================================================================
--- /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/uploadtest.html	(revision 292)
+++ /FCKeditor/branches/developers/alfonsoml/editor/filemanager/connectors/uploadtest.html	(revision 292)
@@ -0,0 +1,133 @@
+<!--
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * Test page for the "File Uploaders".
+-->
+<html>
+	<head>
+		<title>FCKeditor - Uploaders Tests</title>
+		<script language="javascript">
+
+function SendFile()
+{
+	var sUploaderUrl = cmbUploaderUrl.value ;
+
+	if ( sUploaderUrl.length == 0 )
+		sUploaderUrl = txtCustomUrl.value ;
+
+	if ( sUploaderUrl.length == 0 )
+	{
+		alert( 'Please provide your custom URL or select a default one' ) ;
+		return ;
+	}
+
+	eURL.innerHTML = sUploaderUrl ;
+	txtUrl.value = '' ;
+
+	frmUpload.action = sUploaderUrl ;
+	frmUpload.submit() ;
+}
+
+function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
+{
+	switch ( errorNumber )
+	{
+		case 0 :	// No errors
+			txtUrl.value = fileUrl ;
+			alert( 'File uploaded with no errors' ) ;
+			break ;
+		case 1 :	// Custom error
+			alert( customMsg ) ;
+			break ;
+		case 10 :	// Custom warning
+			txtUrl.value = fileUrl ;
+			alert( customMsg ) ;
+			break ;
+		case 201 :
+			txtUrl.value = fileUrl ;
+			alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
+			break ;
+		case 202 :
+			alert( 'Invalid file' ) ;
+			break ;
+		case 203 :
+			alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
+			break ;
+		default :
+			alert( 'Error on file upload. Error number: ' + errorNumber ) ;
+			break ;
+	}
+}
+
+		</script>
+	</head>
+	<body>
+		<table cellSpacing="0" cellPadding="0" width="100%" border="0" height="100%">
+			<tr>
+				<td>
+					<table cellSpacing="0" cellPadding="0" width="100%" border="0">
+						<tr>
+							<td nowrap>
+								Select the "File Uploader" to use:<br>
+								<select id="cmbUploaderUrl">
+									<option selected value="asp/upload.asp">ASP</option>
+									<option value="aspx/upload.aspx">ASP.Net</option>
+									<option value="cfm/upload.cfm">ColdFusion</option>
+									<option value="lasso/upload.lasso">Lasso</option>
+									<option value="php/upload.php">PHP</option>
+									<option value="">(Custom)</option>
+								</select>
+							</td>
+							<td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+							<td width="100%">
+								Custom Uploader URL:<BR>
+								<input id="txtCustomUrl" style="WIDTH: 100%; BACKGROUND-COLOR: #dcdcdc" disabled type="text">
+							</td>
+						</tr>
+					</table>
+					<br>
+					<table cellSpacing="0" cellPadding="0" width="100%" border="0">
+						<tr>
+							<td noWrap>
+								<form id="frmUpload" target="UploadWindow" enctype="multipart/form-data" action="" method="post">
+									Upload a new file:<br>
+									<input type="file" name="NewFile"><br>
+									<input type="button" value="Send it to the Server" onclick="SendFile();">
+								</form>
+							</td>
+							<td style="WIDTH: 16px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
+							<td vAlign="top" width="100%">
+								Uploaded File URL:<br>
+								<INPUT id="txtUrl" style="WIDTH: 100%" readonly type="text">
+							</td>
+						</tr>
+					</table>
+					<br>
+					Post URL: <span id="eURL">&nbsp;</span>
+				</td>
+			</tr>
+			<tr>
+				<td height="100%">
+					<iframe name="UploadWindow" width="100%" height="100%" src="javascript:void(0)"></iframe>
+				</td>
+			</tr>
+		</table>
+	</body>
+</html>
