Index: /FCKeditor/branches/versions/2.6.x/_samples/asp/sample02.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/asp/sample02.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/asp/sample02.asp	(revision 3813)
@@ -87,4 +87,10 @@
 sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )
 
+'This RegExp is used to sanitize recived lang parameter
+Dim oRegex
+Set oRegex = New RegExp
+oRegex.Global		= True
+oRegex.Pattern = "[^a-z\-]"
+
 Dim oFCKeditor
 Set oFCKeditor = New FCKeditor
@@ -96,5 +102,5 @@
 Else
 	oFCKeditor.Config("AutoDetectLanguage") = False
-	oFCKeditor.Config("DefaultLanguage")    = Request.QueryString("Lang")
+	oFCKeditor.Config("DefaultLanguage")    =  oRegex.Replace( Request.QueryString("Lang"), "")
 End If
 
Index: /FCKeditor/branches/versions/2.6.x/_samples/asp/sample03.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/asp/sample03.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/asp/sample03.asp	(revision 3813)
@@ -75,4 +75,10 @@
 sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )
 
+'This RegExp is used to sanitize recived toolbar parameter
+Dim oRegex
+Set oRegex = New RegExp
+oRegex.Global		= True
+oRegex.Pattern = "[^a-zA-Z]"
+
 Dim oFCKeditor
 Set oFCKeditor = New FCKeditor
@@ -80,5 +86,5 @@
 
 If Request.QueryString("Toolbar") <> "" Then
-	oFCKeditor.ToolbarSet = Server.HTMLEncode( Request.QueryString("Toolbar") )
+	oFCKeditor.ToolbarSet = oRegex.Replace( Request.QueryString("Toolbar"), "" )
 End If
 
Index: /FCKeditor/branches/versions/2.6.x/_samples/asp/sample04.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/asp/sample04.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/asp/sample04.asp	(revision 3813)
@@ -81,4 +81,10 @@
 sBasePath = Left( sBasePath, InStrRev( sBasePath, "/_samples" ) )
 
+'This RegExp is used to sanitize recived skin parameter
+Dim oRegex
+Set oRegex = New RegExp
+oRegex.Global		= True
+oRegex.Pattern = "[^a-zA-Z0-9]"
+
 Dim oFCKeditor
 Set oFCKeditor = New FCKeditor
@@ -86,5 +92,5 @@
 
 If Request.QueryString("Skin") <> "" Then
-	oFCKeditor.Config("SkinPath") = sBasePath + "editor/skins/" & Server.HTMLEncode( Request.QueryString("Skin") ) + "/"
+	oFCKeditor.Config("SkinPath") = sBasePath + "editor/skins/" & oRegex.Replace( Request.QueryString("Skin"), "" ) + "/"
 End If
 
Index: /FCKeditor/branches/versions/2.6.x/_samples/asp/sampleposteddata.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/asp/sampleposteddata.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/asp/sampleposteddata.asp	(revision 3813)
@@ -48,5 +48,5 @@
 			%>
 			<tr>
-				<th><%=sForm%></th>
+				<th><%=Server.HTMLEncode( sForm )%></th>
 				<td><pre><%=Server.HTMLEncode( Request.Form(sForm) )%></pre></td>
 			</tr>
Index: /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample02.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample02.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample02.cfm	(revision 3813)
@@ -83,5 +83,5 @@
 <cfif isDefined( "URL.Lang" )>
 	<cfset config["AutoDetectLanguage"]		= false>
-	<cfset config["DefaultLanguage"]		= HTMLEditFormat( URL.Lang )>
+	<cfset config["DefaultLanguage"]		= REReplaceNoCase( URL.Lang, "[^a-z\-]", "", "all" )>
 <cfelse>
 	<cfset config["AutoDetectLanguage"]		= true>
Index: /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample02_mx.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample02_mx.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample02_mx.cfm	(revision 3813)
@@ -96,5 +96,5 @@
 		{
 			fckEditor.config["AutoDetectLanguage"]		= false ;
-			fckEditor.config["DefaultLanguage"]			= HTMLEditFormat( URL.Lang ) ;
+			fckEditor.config["DefaultLanguage"]			= REReplaceNoCase( URL.Lang, "[^a-z\-]", "", "all" ) ;
 		}
 		else
Index: /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample03.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample03.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample03.cfm	(revision 3813)
@@ -68,5 +68,5 @@
 
 <cfif isDefined( "URL.Toolbar" )>
-	<cfset toolbarSet = HTMLEditFormat( URL.Toolbar )>
+	<cfset toolbarSet = REReplaceNoCase( URL.Toolbar, "[^a-z]", "", "all" )>
 <cfelse>
 	<cfset toolbarSet = "Default">
Index: /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample03_mx.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample03_mx.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample03_mx.cfm	(revision 3813)
@@ -82,5 +82,5 @@
 		if ( isDefined( "URL.Toolbar" ) )
 		{
-			fckEditor.ToolbarSet		= HTMLEditFormat( URL.Toolbar ) ;
+			fckEditor.ToolbarSet		= REReplaceNoCase( URL.Toolbar, "[^a-z]", "", "all" ) ;
 		}
 		fckEditor.create() ; // create the editor.
Index: /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample04.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample04.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample04.cfm	(revision 3813)
@@ -78,5 +78,5 @@
 <cfset config = structNew()>
 <cfif isDefined( "URL.Skin" )>
-	<cfset config["SkinPath"] = basePath & 'editor/skins/' & HTMLEditFormat( URL.Skin ) & '/'>
+	<cfset config["SkinPath"] = basePath & 'editor/skins/' & REReplaceNoCase( URL.Skin, "[^a-z0-9]", "", "all" ) & '/'>
 </cfif>
 
Index: /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample04_mx.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample04_mx.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/cfm/sample04_mx.cfm	(revision 3813)
@@ -88,5 +88,5 @@
 		if ( isDefined( "URL.Skin" ) )
 		{
-			fckEditor.config['SkinPath'] = basePath & 'editor/skins/' & HTMLEditFormat( URL.Skin ) & '/' ;
+			fckEditor.config['SkinPath'] = basePath & 'editor/skins/' & REReplaceNoCase( URL.Skin, "[^a-z0-9]", "", "all" ) & '/' ;
 		}
 		fckEditor.create() ; // create the editor.
Index: /FCKeditor/branches/versions/2.6.x/_samples/cfm/sampleposteddata.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/cfm/sampleposteddata.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/cfm/sampleposteddata.cfm	(revision 3813)
@@ -35,5 +35,4 @@
 		This page lists all data posted by the form.
 		<hr>
-<cfif listFirst( server.coldFusion.productVersion ) LT 6>
 	<cfif isDefined( 'FORM.fieldnames' )>
 		<cfoutput>
@@ -49,20 +48,23 @@
 		<tr>
 			<th>FieldNames</th>
-			<td>#FORM.fieldNames#</td>
+			<td>#HTMLEditFormat( FORM.fieldNames )#</td>
 		</tr>
 		<cfloop list="#FORM.fieldnames#" index="key">
-		<tr>
-			<th>#key#</th>
-			<td><pre>#HTMLEditFormat( evaluate( "FORM.#key#" ) )#</pre></td>
-		</tr>
+			<tr>
+				<th>#HTMLEditFormat( key )#</th>
+				<td><pre>
+			<cftry>
+				<cfif isDefined( 'FORM.' & #key# ) and REFindNoCase("^[a-z0-9]+$", key)>
+					#HTMLEditFormat( evaluate( "FORM.#key#" ) )#
+				</cfif>
+			<cfcatch type="any">
+			</cfcatch>
+			</cftry>
+				</pre></td>
+			</tr>
 		</cfloop>
 		</table>
 		</cfoutput>
 	</cfif>
-<cfelse>
-	<cfdump var="#FORM#" label="Dump of FORM Variables">
-</cfif>
-
-
 	</body>
 </html>
Index: /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample02.lasso
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample02.lasso	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample02.lasso	(revision 3813)
@@ -85,5 +85,5 @@
 		var('config') = array(
 			'AutoDetectLanguage' = 'false',
-			'DefaultLanguage' = action_param('Lang')
+			'DefaultLanguage' = (String_ReplaceRegExp: action_param('Lang'), -find='[^a-z\-]', -replace='')
 		);
 	else;
Index: /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample03.lasso
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample03.lasso	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample03.lasso	(revision 3813)
@@ -76,5 +76,5 @@
 
 	if(action_param('Toolbar'));
-		$myeditor->toolbarset = action_param('Toolbar');
+		$myeditor->toolbarset = (String_ReplaceRegExp: action_param('Toolbar'), -find='[^a-zA-Z]', -replace='');
 	/if;
 
Index: /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample04.lasso
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample04.lasso	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/lasso/sample04.lasso	(revision 3813)
@@ -82,5 +82,6 @@
 
 	if(action_param('Skin'));
-		$myeditor->config = array('SkinPath' = $basepath + 'editor/skins/' + action_param('Skin') + '/');
+		var('skin') = (String_ReplaceRegExp: action_param('Skin'), -find='[^a-zA-Z0-9]', -replace='');
+		$myeditor->config = array('SkinPath' = $basepath + 'editor/skins/' + $skin + '/');
 	/if;
 
Index: /FCKeditor/branches/versions/2.6.x/_samples/lasso/sampleposteddata.lasso
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/lasso/sampleposteddata.lasso	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/lasso/sampleposteddata.lasso	(revision 3813)
@@ -45,6 +45,6 @@
 [iterate(client_postparams, local('this'))]
 			<tr>
-				<th>[#this->first]</th>
-				<td><pre>[#this->second]</pre></td>
+				<th>[Encode_HTML: #this->first]</th>
+				<td><pre>[Encode_HTML: #this->second]</pre></td>
 			</tr>
 [/iterate]
Index: /FCKeditor/branches/versions/2.6.x/_samples/perl/sample02.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/perl/sample02.cgi	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/perl/sample02.cgi	(revision 3813)
@@ -145,5 +145,7 @@
 	if($FORM{'Lang'} ne "") {
 		$Config{'AutoDetectLanguage'}	= "false";
-		$Config{'DefaultLanguage'}		= $FORM{'Lang'};
+		$lang = $FORM{'Lang'};
+		$lang =~ s/[^a-z\-]//ig;
+		$Config{'DefaultLanguage'}		= $lang;
 	} else {
 		$Config{'AutoDetectLanguage'}	= "true";
Index: /FCKeditor/branches/versions/2.6.x/_samples/perl/sample03.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/perl/sample03.cgi	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/perl/sample03.cgi	(revision 3813)
@@ -133,5 +133,6 @@
 
 	if($FORM{'Toolbar'} ne "") {
-		$ToolbarSet = &specialchar_cnv( $FORM{'Toolbar'} );
+		$ToolbarSet = $FORM{'Toolbar'};
+		$ToolbarSet =~ s/[^a-z]//ig;
 	}
 	$Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
Index: /FCKeditor/branches/versions/2.6.x/_samples/perl/sample04.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/perl/sample04.cgi	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/perl/sample04.cgi	(revision 3813)
@@ -140,5 +140,7 @@
 
 	if($FORM{'Skin'} ne "") {
-		$Config{'SkinPath'} = $sBasePath . 'editor/skins/' . &specialchar_cnv( $FORM{'Skin'} ) . '/' ;
+		$skin = $FORM{'Skin'};
+		$skin =~ s/[^a-z0-9]//ig;
+		$Config{'SkinPath'} = $sBasePath . 'editor/skins/' . $skin . '/' ;
 	}
 	$Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
Index: /FCKeditor/branches/versions/2.6.x/_samples/perl/sampleposteddata.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/perl/sampleposteddata.cgi	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/perl/sampleposteddata.cgi	(revision 3813)
@@ -94,4 +94,5 @@
 	foreach $key (keys %FORM) {
 		$postedValue = &specialchar_cnv($FORM{$key});
+		$key = &specialchar_cnv($key);
 		print <<"_HTML_TAG_";
 			<tr>
Index: /FCKeditor/branches/versions/2.6.x/_samples/php/sample02.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/php/sample02.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/php/sample02.php	(revision 3813)
@@ -92,5 +92,5 @@
 {
 	$oFCKeditor->Config['AutoDetectLanguage']	= false ;
-	$oFCKeditor->Config['DefaultLanguage']		= $_GET['Lang'] ;
+	$oFCKeditor->Config['DefaultLanguage']		= preg_replace("/[^a-z\-]/i", "", $_GET['Lang']) ;
 }
 else
Index: /FCKeditor/branches/versions/2.6.x/_samples/php/sample03.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/php/sample03.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/php/sample03.php	(revision 3813)
@@ -78,5 +78,5 @@
 
 if ( isset($_GET['Toolbar']) )
-	$oFCKeditor->ToolbarSet = htmlspecialchars($_GET['Toolbar']);
+	$oFCKeditor->ToolbarSet = preg_replace("/[^a-z]/i", "", $_GET['Toolbar']);
 
 $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
Index: /FCKeditor/branches/versions/2.6.x/_samples/php/sample04.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/php/sample04.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/php/sample04.php	(revision 3813)
@@ -84,5 +84,5 @@
 
 if ( isset($_GET['Skin']) )
-	$oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . htmlspecialchars($_GET['Skin']) . '/' ;
+	$oFCKeditor->Config['SkinPath'] = $sBasePath . 'editor/skins/' . preg_replace("/[^a-z0-9]/i", "", $_GET['Skin']) . '/' ;
 
 $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
Index: /FCKeditor/branches/versions/2.6.x/_samples/php/sampleposteddata.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/php/sampleposteddata.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/php/sampleposteddata.php	(revision 3813)
@@ -59,5 +59,5 @@
 ?>
 			<tr>
-				<th><?php echo $sForm?></th>
+				<th><?php echo htmlspecialchars($sForm) ?></th>
 				<td><pre><?php echo $postedValue?></pre></td>
 			</tr>
Index: /FCKeditor/branches/versions/2.6.x/_samples/py/sample01.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/py/sample01.py	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/py/sample01.py	(revision 3813)
@@ -69,8 +69,8 @@
 
 # For testing your environments
-print "<hr>"
-for key in os.environ.keys():
-	print "%s: %s<br>" % (key, os.environ.get(key, ""))
-print "<hr>"
+#print "<hr>"
+#for key in os.environ.keys():
+#	print "%s: %s<br>" % (key, os.environ.get(key, ""))
+#print "<hr>"
 
 # Document footer
Index: /FCKeditor/branches/versions/2.6.x/_samples/py/sampleposteddata.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/py/sampleposteddata.py	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_samples/py/sampleposteddata.py	(revision 3813)
@@ -71,5 +71,5 @@
 					<td><pre>%s</pre></td>
 				</tr>
-			""" % (key, value)
+			""" % (cgi.escape(key), cgi.escape(value))
 	except Exception, e:
 		print e
@@ -77,8 +77,8 @@
 
 # For testing your environments
-print "<hr>"
-for key in os.environ.keys():
-	print "%s: %s<br>" % (key, os.environ.get(key, ""))
-print "<hr>"
+#print "<hr>"
+#for key in os.environ.keys():
+#	print "%s: %s<br>" % (key, os.environ.get(key, ""))
+#print "<hr>"
 
 # Document footer
Index: /FCKeditor/branches/versions/2.6.x/_whatsnew.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_whatsnew.html	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/_whatsnew.html	(revision 3813)
@@ -33,4 +33,11 @@
 	<h1>
 		FCKeditor ChangeLog - What's New?</h1>
+	<h3>
+		Version 2.6.4.1</h3>
+	<p>
+		Fixed Bugs:</p>
+	<ul>
+		<li><strong>Security release, upgrade is highly recommended.</strong></li>
+	</ul>
 	<h3>
 		Version 2.6.4</h3>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/basexml.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/basexml.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/basexml.asp	(revision 3813)
@@ -57,5 +57,9 @@
 	Response.Write "<?xml version=""1.0"" encoding=""utf-8"" ?>"
 
+	If text <> "" then
 	Response.Write "<Connector><Error number=""" & number & """ text=""" & Server.HTMLEncode( text ) & """ /></Connector>"
+	else
+	Response.Write "<Connector><Error number=""" & number & """ /></Connector>"
+	end if
 
 	Response.End
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/commands.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/commands.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/commands.asp	(revision 3813)
@@ -131,5 +131,5 @@
 
 	' Create the "Error" node.
-	Response.Write "<Error number=""" & sErrorNumber & """ originalNumber=""" & iErrNumber & """ originalDescription=""" & ConvertToXmlAttribute( sErrDescription ) & """ />"
+	Response.Write "<Error number=""" & sErrorNumber & """ />"
 End Sub
 
@@ -193,5 +193,9 @@
 	sFileUrl = CombinePaths( sFileUrl, sFileName )
 
-	SendUploadResults sErrorNumber, sFileUrl, sFileName, ""
+	If ( sErrorNumber = "0" or sErrorNumber = "201" ) then
+		SendUploadResults sErrorNumber, sFileUrl, sFileName, ""
+	Else
+		SendUploadResults sErrorNumber, "", "", ""
+	End If
 End Sub
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/connector.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/connector.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/connector.asp	(revision 3813)
@@ -58,5 +58,5 @@
 	' Check if it is an allowed resource type.
 	if ( Not IsAllowedType( sResourceType ) ) Then
-		SendError 1, "The """ & sResourceType & """ resource type isn't allowed"
+		SendError 1, "Invalid type specified"
 	end if
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/io.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/io.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/io.asp	(revision 3813)
@@ -176,4 +176,6 @@
 function GetCurrentFolder()
 	dim sCurrentFolder
+	dim oRegex
+
 	sCurrentFolder = Request.QueryString("CurrentFolder")
 	If ( sCurrentFolder = "" ) Then sCurrentFolder = "/"
@@ -185,4 +187,12 @@
 	' Check for invalid folder paths (..)
 	If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sCurrentFolder, "\" ) <> 0) Then
+		SendError 102, ""
+	End If
+
+	Set oRegex = New RegExp
+	oRegex.Global		= True
+	oRegex.Pattern = "(/\.)|(//)|([\\:\*\?\""\<\>\|]|[\u0000-\u001F]|\u007F)"
+
+	if (oRegex.Test(sCurrentFolder)) Then
 		SendError 102, ""
 	End If
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/upload.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/upload.asp	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/upload.asp	(revision 3813)
@@ -49,5 +49,5 @@
 	If ( sResourceType = "" ) Then sResourceType = "File"
 
-	sCurrentFolder = GetCurrentFolder()
+	sCurrentFolder = "/"
 
 	' Is Upload enabled?
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_connector.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_connector.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_connector.cfm	(revision 3813)
@@ -103,6 +103,31 @@
 	rootPath = left( serverPath, Len(serverPath) - Len(userFilesPath) ) ;
 	xmlContent = ""; // append to this string to build content
+	invalidName = false;
 </cfscript>
 
+
+<cfif not config.enabled>
+
+	<cfset xmlContent = "<Error number=""1"" text=""This connector is disabled. Please check the 'editor/filemanager/connectors/cfm/config.cfm' file"" />">
+
+<cfelseif find("..",url.currentFolder) or find("\",url.currentFolder) or REFind('(/\.)|(//)|[[:cntrl:]]|([\\:\*\?\"<>])', url.currentFolder)>
+
+	<cfset invalidName = true>
+	<cfset xmlContent = "<Error number=""102"" />">
+
+<cfelseif isDefined("Config.ConfigAllowedCommands") and not ListFind(Config.ConfigAllowedCommands, url.command)>
+
+	<cfset invalidName = true>
+	<cfset xmlContent = '<Error number="1" text="The &quot;' & HTMLEditFormat(url.command) & '&quot; command isn''t allowed" />'>
+
+<cfelseif isDefined("Config.ConfigAllowedTypes") and not ListFind(Config.ConfigAllowedTypes, url.type)>
+
+	<cfset invalidName = true>
+	<cfset xmlContent = '<Error number="1" text="Invalid type specified" />'>
+
+</cfif>
+
+<cfset resourceTypeUrl = "">
+<cfif not len(xmlContent)>
 <cfset resourceTypeUrl = rereplace( replace( Config.FileTypesPath[url.type], fs, "/", "all"), "/$", "") >
 
@@ -126,23 +151,6 @@
 <cfset userFilesServerPath = replace( userFilesServerPath, fs & fs, fs, "all") >
 
-<cfif not config.enabled>
-
-	<cfset xmlContent = "<Error number=""1"" text=""This connector is disabled. Please check the 'editor/filemanager/connectors/cfm/config.cfm' file"" />">
-
-<cfelseif find("..",url.currentFolder) or find("\",url.currentFolder)>
-
-	<cfset xmlContent = "<Error number=""102"" />">
-
-<cfelseif isDefined("Config.ConfigAllowedCommands") and not ListFind(Config.ConfigAllowedCommands, url.command)>
-
-	<cfset xmlContent = '<Error number="1" text="The &quot;' & url.command & '&quot; command isn''t allowed" />'>
-
-<cfelseif isDefined("Config.ConfigAllowedTypes") and not ListFind(Config.ConfigAllowedTypes, url.type)>
-
-	<cfset xmlContent = '<Error number="1" text="The &quot;' & url.type & '&quot; type isn''t allowed" />'>
-
-</cfif>
-
 <cfset resourceTypeDirectory = left( userFilesServerPath, Len(userFilesServerPath) - Len(url.currentFolder) )>
+</cfif>
 
 <cfif not len(xmlContent) and not directoryexists(resourceTypeDirectory)>
@@ -264,4 +272,5 @@
 					newFolderName = reReplace(newFolderName, "([^_]+)_+$", "\1", "all");
 					newFolderName = reReplace(newFolderName, "$_([^_]+)$", "\1", "all");
+					newFolderName = reReplace(newFolderName, '\.+', "_", "all" );
 				}
 			</cfscript>
@@ -272,5 +281,5 @@
 				<cfset errorNumber = 101>
 			<cfelseif reFind("^\.\.",newFolderName)>
-				<cfset errorNumber = 103>
+				<cfset errorNumber = 102>
 			<cfelse>
 				<cfset errorNumber = 0>
@@ -304,6 +313,12 @@
 
 <cfscript>
-	xmlHeader = '<?xml version="1.0" encoding="utf-8" ?><Connector command="#url.command#" resourceType="#url.type#">';
-	xmlHeader = xmlHeader & '<CurrentFolder path="#url.currentFolder#" url="#resourceTypeUrl##url.currentFolder#" />';
+	xmlHeader = '<?xml version="1.0" encoding="utf-8" ?>';
+	if (invalidName) {
+		xmlHeader = xmlHeader & '<Connector>';
+	}
+	else {
+		xmlHeader = xmlHeader & '<Connector command="#url.command#" resourceType="#url.type#">';
+		xmlHeader = xmlHeader & '<CurrentFolder path="#url.currentFolder#" url="#resourceTypeUrl##url.currentFolder#" />';
+	}
 	xmlFooter = '</Connector>';
 </cfscript>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_upload.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_upload.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_upload.cfm	(revision 3813)
@@ -40,4 +40,8 @@
 <cfparam name="url.currentFolder" default="/">
 
+<cfif url.command eq "QuickUpload">
+	<cfset url.currentFolder = "/">
+</cfif>
+
 <cfif not isDefined("config_included")>
 	<cfinclude template="config.cfm">
@@ -75,4 +79,10 @@
 	<cfabort>
 </cfif>
+
+<cfif REFind('(/\.)|(//)|[[:cntrl:]]|([\\:\*\?\"<>])', url.currentFolder)>
+	<cfset SendUploadResults(102)>
+	<cfabort>
+</cfif>
+
 
 <cfscript>
@@ -139,5 +149,5 @@
 		</cftry>
 	</cfif>
-<cfelse>
+<cfelseif url.command eq "FileUpload">
 	<cfset resourceTypeUrl = rereplace( replace( Config.FileTypesPath[url.type], fs, "/", "all"), "/$", "") >
 	<cfif isDefined( "Config.FileTypesAbsolutePath" )
@@ -287,5 +297,5 @@
 <cfif errorNumber EQ 0>
 	<!--- file was uploaded succesfully --->
-	<cfset SendUploadResults(errorNumber, '#resourceTypeUrl##url.currentFolder##fileName#.#fileExt#', "", "")>
+	<cfset SendUploadResults(errorNumber, '#resourceTypeUrl##url.currentFolder##fileName#.#fileExt#', replace( fileName & "." & fileExt, "'", "\'", "ALL"), "")>
 	<cfabort>
 <cfelseif errorNumber EQ 201>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_basexml.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_basexml.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_basexml.cfm	(revision 3813)
@@ -65,4 +65,8 @@
 	<cfargument name="number" required="true" type="Numeric">
 	<cfargument name="text" required="true">
-	<cfoutput><Error number="#ARGUMENTS.number#" text="#htmleditformat(ARGUMENTS.text)#" /></cfoutput>
+	<cfif Len(ARGUMENTS.text)>
+		<cfoutput><Error number="#ARGUMENTS.number#" text="#htmleditformat(ARGUMENTS.text)#" /></cfoutput>
+	<cfelse>
+		<cfoutput><Error number="#ARGUMENTS.number#" /></cfoutput>
+	</cfif>
 </cffunction>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_commands.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_commands.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_commands.cfm	(revision 3813)
@@ -36,5 +36,5 @@
 	<cfset var sTempFilePath = "">
 	<cfset var errorNumber = 0>
-	<cfset var customMsg = 0>
+	<cfset var customMsg = "">
 	<cfset var counter = 0>
 	<cfset var destination = "">
@@ -227,4 +227,4 @@
 	</cfif>
 
-	<cfoutput><Error number="#errorNumber#" originalDescription="#HTMLEditFormat(sErrorMsg)#" /></cfoutput>
-</cffunction>
+	<cfoutput><Error number="#errorNumber#" /></cfoutput>
+</cffunction>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_io.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_io.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_io.cfm	(revision 3813)
@@ -194,6 +194,10 @@
 	<cfset sCurrentFolder = rereplace( sCurrentFolder, "//+", "/", "all" )>
 
-	<cfif find( "..", sCurrentFolder) or find( "\", sCurrentFolder) >
-		<cfset SendError( 102, "" )>
+	<cfif find( "..", sCurrentFolder) or find( "\", sCurrentFolder) or REFind('(/\.)|(//)|[[:cntrl:]]|([\\:\*\?\"<>])', sCurrentFolder)>
+		<cfif URL.Command eq "FileUpload" or URL.Command eq "QuickUpload">
+			<cfset SendUploadResults( 102, "", "", "") >
+		<cfelse>
+			<cfset SendError( 102, "" )>
+		</cfif>
 	</cfif>
 
@@ -266,4 +270,8 @@
 	<cfargument name="customMsg" required="false" type="String" default="">
 
+	<cfif errorNumber and errorNumber neq 201>
+		<cfset fileUrl = "">
+		<cfset fileName = "">
+	</cfif>
 	<!--- Minified version of the document.domain automatic fix script (#1919).
 	The original script can be found at _dev/domain_fix_template.js --->
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_upload.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_upload.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_upload.cfm	(revision 3813)
@@ -25,5 +25,4 @@
 
 <cfparam name="url.type" default="File">
-<cfparam name="url.currentFolder" default="/">
 
 <!--- note: no serverPath url parameter - see config.cfm if you need to set the serverPath manually --->
@@ -37,5 +36,5 @@
 	<cfargument name="number" required="true" type="Numeric">
 	<cfargument name="text" required="true">
-	<cfreturn SendUploadResults( "#ARGUMENTS.number#", "", "", "ARGUMENTS.text" )>
+	<cfreturn SendUploadResults( "#ARGUMENTS.number#", "", "", "#ARGUMENTS.text#" )>
 </cffunction>
 
@@ -58,5 +57,5 @@
 </cfif>
 
-<cfset sCurrentFolder = GetCurrentFolder()>
+<cfset sCurrentFolder = "/">
 
 <!--- Is enabled the upload? --->
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/config.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/config.cfm	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/config.cfm	(revision 3813)
@@ -28,9 +28,4 @@
 	// SECURITY: You must explicitly enable this "connector". (Set enabled to "true")
 	Config.Enabled = false ;
-
-	// @Packager.Remove.Start
-	// Attention: In the development version (SVN) the ColdFusion connector is enabled by default.
-	Config.Enabled = true ;
-	// @Packager.Remove.End
 
 	// Path to uploaded files relative to the document root.
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/connector.lasso
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/connector.lasso	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/connector.lasso	(revision 3813)
@@ -39,6 +39,6 @@
     */
 	var(
-		'Command'		=	action_param('Command'),
-		'Type'			=	action_param('Type'),
+		'Command'		=	(Encode_HTML: action_param('Command')),
+		'Type'			=	(Encode_HTML: action_param('Type')),
 		'CurrentFolder'	=	action_param('CurrentFolder'),
 		'ServerPath'	=	action_param('ServerPath'),
@@ -71,43 +71,14 @@
 		$__html_reply__ = '\
 <script type="text/javascript">
-(function()
-{
-	var d = document.domain ;
-
-	while ( true )
-	{
-		// Test if we can access a parent property.
-		try
-		{
-			var test = window.top.opener.document.domain ;
-			break ;
-		}
-		catch( e ) {}
-
-		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
-		d = d.replace( /.*?(?:\\.|$)/, "" ) ;
-
-		if ( d.length == 0 )
-			break ;		// It was not able to detect the domain.
-
-		try
-		{
-			document.domain = d ;
-		}
-		catch (e)
-		{
-			break ;
-		}
-	}
-})() ;
+(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|$)/,\'\');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
 ';
 			if($uploadResult == '0' || $uploadResult == '201');
 			$__html_reply__ = $__html_reply__ + '\
-	window.parent.OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\');
+	window.parent.OnUploadCompleted(' + $uploadResult + ',"' + $NewFilePath + '","' + $NewFilePath->split('/')->last + '");
 </script>
 			';
 			else;
 			$__html_reply__ = $__html_reply__ + '\
-	window.parent.OnUploadCompleted(' + $uploadResult + ');
+	window.parent.OnUploadCompleted(' + $uploadResult + ',"","");
 </script>
 			';
@@ -126,5 +97,18 @@
 	);
 
-	if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\'));
+	$currentFolderURL = string_replace($currentFolderURL, -find='//', -replace='/');
+
+	if (!$config->find('Subdirectories')->find(action_param('Type')));
+		if($Command == 'FileUpload');
+			$responseType = 'html';
+			$uploadResult = '1';
+			fck_htmlreply(
+				-uploadResult=$uploadResult
+			);
+		else;
+			$errorNumber = 1;
+			$commandData += '<Error number="' + $errorNumber + '" text="Invalid type specified" />\n';
+		/if;
+	else if($CurrentFolder->(Find: '..') || (String_FindRegExp: $CurrentFolder, -Find='(/\\.)|(//)|[\\\\:\\*\\?\\""\\<\\>\\|]|\\000|[\u007F]|[\u0001-\u001F]'));
 		if($Command == 'FileUpload');
 			$responseType = 'html';
@@ -143,5 +127,6 @@
     entire process in an inline for file tag permissions.
     */
-	inline($connection);
+		if($config->find('Enabled'));
+		inline($connection);
 		select($Command);
             /*.............................................................
@@ -167,5 +152,11 @@
 						$folders += '\t\t<Folder name="' + #this->removetrailing('/')& + '" />\n';
 					else;
-						local('size') = file_getsize($currentFolderURL + #this) / 1024;
+						local('size') = file_getsize($currentFolderURL + #this);
+						if($size>0);
+							$size = $size/1024;
+							if ($size==0);
+								$size = 1;
+							/if;
+						/if;
 						$files += '\t\t<File name="' + #this + '" size="' + #size + '" />\n';
 					/if;
@@ -182,5 +173,5 @@
             */
 			case('CreateFolder');
-				$NewFolderName = (String_ReplaceRegExp: $NewFolderName, -find='\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
+				$NewFolderName = (String_ReplaceRegExp: $NewFolderName, -find='\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|\\000|[\u007F]|[\u0001-\u001F]', -replace='_');
 				var('newFolder' = $currentFolderURL + $NewFolderName + '/');
 				file_create($newFolder);
@@ -234,9 +225,10 @@
                     */
 					$NewFileName = $NewFile->find('OrigName');
-					$NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
+					$NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|\\000|[\u007F]|[\u0001-\u001F]', -replace='_');
+					$NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\.(?![^.]*$)', -replace='_');
 					$OrigFilePath = $currentFolderURL + $NewFileName;
 					$NewFilePath = $OrigFilePath;
 					local('fileExtension') = '.' + $NewFile->find('OrigExtension');
-					#fileExtension = (String_ReplaceRegExp: #fileExtension, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
+					#fileExtension = (String_ReplaceRegExp: #fileExtension, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|\\000|[\u007F]|[\u0001-\u001F]', -replace='_');
 					local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&;
 
@@ -245,5 +237,9 @@
                     Make sure the file extension is allowed.
                     */
-					if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension'));
+					local('allowedExt') = $config->find('AllowedExtensions')->find($Type);
+					local('deniedExt') = $config->find('DeniedExtensions')->find($Type);
+					if($allowedExt->Size > 0 && $allowedExt !>> $NewFile->find('OrigExtension'));
+						$uploadResult = '202';
+					else($deniedExt->Size > 0 && $deniedExt >> $NewFile->find('OrigExtension'));
 						$uploadResult = '202';
 					else;
@@ -278,6 +274,13 @@
 					-NewFilePath=$NewFilePath
 				);
+			case;
+				$errorNumber = 1;
+				$commandData += '<Error number="' + $errorNumber + '" text="Command isn\'t allowed" />\n';
 		/select;
-	/inline;
+		/inline;
+		else;
+			$errorNumber = 1;
+			$commandData += '<Error number="' + $errorNumber + '" text="This file uploader is disabled. Please check the editor/filemanager/upload/lasso/config.lasso file." />\n';
+		/if;
 	/if;
 
@@ -310,9 +313,14 @@
 		*/
 		$__html_reply__ = '\
-<?xml version="1.0" encoding="utf-8" ?>
-<Connector command="' + $Command + '" resourceType="' + $Type + '">';
+<?xml version="1.0" encoding="utf-8" ?>';
 
 		if($errorNumber != '102');
-			$__html_reply__ += '<CurrentFolder path="' + $CurrentFolder + '" url="' + $currentFolderURL + '" />';
+			$__html_reply__ += '<Connector command="' + (Encode_HTML: $Command) + '" resourceType="' + (Encode_HTML: $Type) + '">';
+		else;
+			$__html_reply__ += '<Connector>';
+		/if;
+
+		if($errorNumber != '102');
+			$__html_reply__ += '<CurrentFolder path="' + (Encode_HTML: $CurrentFolder) + '" url="' + (Encode_HTML: $currentFolderURL) + '" />';
 		/if;
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/upload.lasso
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/upload.lasso	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/upload.lasso	(revision 3813)
@@ -33,6 +33,6 @@
     */
 	var(
-		'Type'			=	action_param('Type'),
-		'CurrentFolder'	=	action_param('CurrentFolder'),
+		'Type'			=	(Encode_HTML: action_param('Type')),
+		'CurrentFolder'	=	"/",
 		'ServerPath'	=	action_param('ServerPath'),
 		'NewFile'		=	null,
@@ -54,6 +54,8 @@
 	var('currentFolderURL' = $ServerPath
 		+ $config->find('Subdirectories')->find(action_param('Type'))
-		+ action_param('CurrentFolder')
+		+ $CurrentFolder
 	);
+
+	$currentFolderURL = string_replace($currentFolderURL, -find='//', -replace='/');
 
 	/*.....................................................................
@@ -85,12 +87,12 @@
 		$__html_reply__ = $__html_reply__ + '\
 	window.parent.OnUploadCompleted(' + #errorNumber + ',"'
-		+ string_replace(#fileUrl, -find='"', -replace='\\"') + '","'
-		+ string_replace(#fileName, -find='"', -replace='\\"') + '","'
-		+ string_replace(#customMsg, -find='"', -replace='\\"') + '");
+		+ string_replace((Encode_HTML: #fileUrl), -find='"', -replace='\\"') + '","'
+		+ string_replace((Encode_HTML: #fileUrl->split('/')->last), -find='"', -replace='\\"') + '","'
+		+ string_replace((Encode_HTML: #customMsg), -find='"', -replace='\\"') + '");
 </script>
 		';
 	/define_tag;
 
-	if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\'));
+	if($CurrentFolder->(Find: '..') || (String_FindRegExp: $CurrentFolder, -Find='(/\\.)|(//)|[\\\\:\\*\\?\\""\\<\\>\\|]|\\000|[\u007F]|[\u0001-\u001F]'));
 		$errorNumber = 102;
 	/if;
@@ -115,4 +117,6 @@
 				*/
 				$NewFileName = $NewFile->find('OrigName');
+				$NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|\\000|[\u007F]|[\u0001-\u001F]', -replace='_');
+				$NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\.(?![^.]*$)', -replace='_');
 				$OrigFilePath = $currentFolderURL + $NewFileName;
 				$NewFilePath = $OrigFilePath;
@@ -125,5 +129,9 @@
 				*/
 
-				if($config->find('DeniedExtensions')->find($Type) >> $NewFile->find('OrigExtension'));
+				local('allowedExt') = $config->find('AllowedExtensions')->find($Type);
+				local('deniedExt') = $config->find('DeniedExtensions')->find($Type);
+				if($allowedExt->Size > 0 && $allowedExt !>> $NewFile->find('OrigExtension'));
+					$errorNumber = 202;
+				else($deniedExt->Size > 0 && $deniedExt >> $NewFile->find('OrigExtension'));
 					$errorNumber = 202;
 				else;
@@ -154,4 +162,7 @@
 				/if;
 			/if;
+			if ($errorNumber != 0 && $errorNumber != 201);
+				$NewFilePath = "";
+			/if;
 		/inline;
 	else;
@@ -163,5 +174,4 @@
 		-errorNumber=$errorNumber,
 		-fileUrl=$NewFilePath,
-		-fileName=$NewFileName,
 		-customMsg=$customMsg
 	);
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/basexml.pl
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/basexml.pl	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/basexml.pl	(revision 3813)
@@ -56,5 +56,10 @@
 	print '<?xml version="1.0" encoding="utf-8" ?>' ;
 
-	print '<Connector><Error number="' . $number . '" text="' . &specialchar_cnv( $text ) . '" /></Connector>' ;
+	if ($text) {
+		print '<Connector><Error number="' . $number . '" text="' . &specialchar_cnv( $text ) . '" /></Connector>' ;
+	}
+	else {
+		print '<Connector><Error number="' . $number . '" /></Connector>' ;
+	}
 
 	exit ;
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/commands.pl
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/commands.pl	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/commands.pl	(revision 3813)
@@ -113,5 +113,5 @@
 	# Create the "Error" node.
 	$cnv_errmsg = &ConvertToXmlAttribute($sErrorMsg);
-	print '<Error number="' . $sErrorNumber . '" originalDescription="' . $cnv_errmsg . '" />';
+	print '<Error number="' . $sErrorNumber . '" />';
 }
 
@@ -121,4 +121,5 @@
 
 	local($resourceType, $currentFolder) = @_;
+	$allowedExtensions = $allowedExtensions{$resourceType};
 
 	$sErrorNumber = '0' ;
@@ -131,4 +132,16 @@
 		$sFileName = $new_fname;
 		$sFileName =~ s/\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
+		$sFileName =~ s/\.(?![^.]*$)/_/g;
+
+		$ext = '';
+		if($sFileName =~ /([^\\\/]*)\.(.*)$/) {
+			$ext  = $2;
+		}
+
+		$allowedRegex = qr/^($allowedExtensions)$/i;
+		if (!($ext =~ $allowedRegex)) {
+			SendUploadResults('202', '', '', '');
+		}
+
 		$sOriginalFileName = $sFileName;
 
@@ -162,5 +175,5 @@
 	$sFileName	=~ s/"/\\"/g;
 
-	SendUploadResults($sErrorNumber, $resourceType.$currentFolder.$sFileName, $sFileName, '');
+	SendUploadResults($sErrorNumber, $GLOBALS{'UserFilesPath'}.$resourceType.$currentFolder.$sFileName, $sFileName, '');
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/config.pl
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/config.pl	(revision 3813)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/config.pl	(revision 3813)
@@ -0,0 +1,40 @@
+#####
+#  FCKeditor - The text editor for Internet - http://www.fckeditor.net
+#  Copyright (C) 2003-2009 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 ==
+#
+#  This is the File Manager Connector for Perl.
+#####
+
+##
+# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR.
+##
+&SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/config.cgi" file' ) ;
+
+$GLOBALS{'UserFilesPath'} = '/userfiles/';
+
+# Map the "UserFiles" path to a local directory.
+$rootpath = &GetRootPath();
+$GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'};
+
+%allowedExtensions =  ("File", "7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip",
+"Image", "bmp|gif|jpeg|jpg|png",
+"Flash", "swf|flv",
+"Media", "aiff|asf|avi|bmp|fla|flv|gif|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|png|qt|ram|rm|rmi|rmvb|swf|tif|tiff|wav|wma|wmv"
+);
+
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/connector.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/connector.cgi	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/connector.cgi	(revision 3813)
@@ -25,5 +25,5 @@
 
 ##
-# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file.
+# ATTENTION: To enable this connector, look for the "SECURITY" comment in config.pl.
 ##
 
@@ -59,26 +59,8 @@
 require 'commands.pl';
 require 'upload_fck.pl';
+require 'config.pl';
 
-##
-# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR.
-##
-	&SendError( 1, 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/connector.cgi" file' ) ;
-
-	&read_input();
-
-	if($FORM{'ServerPath'} ne "") {
-		$GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'};
-		if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) {
-			$GLOBALS{'UserFilesPath'} .= '/' ;
-		}
-	} else {
-		$GLOBALS{'UserFilesPath'} = '/userfiles/';
-	}
-
-	# Map the "UserFiles" path to a local directory.
-	$rootpath = &GetRootPath();
-	$GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'};
-
-	&DoResponse();
+&read_input();
+&DoResponse();
 
 sub DoResponse
@@ -89,7 +71,15 @@
 	}
 	# Get the main request informaiton.
-	$sCommand		= $FORM{'Command'};
-	$sResourceType	= $FORM{'Type'};
+	$sCommand		= &specialchar_cnv($FORM{'Command'});
+	$sResourceType	= &specialchar_cnv($FORM{'Type'});
 	$sCurrentFolder	= $FORM{'CurrentFolder'};
+
+	if ( !($sCommand =~ /^(FileUpload|GetFolders|GetFoldersAndFiles|CreateFolder)$/) ) {
+		SendError( 1, "Command not allowed" ) ;
+	}
+
+	if ( !($sResourceType =~ /^(File|Image|Flash|Media)$/) ) {
+		SendError( 1, "Invalid type specified" ) ;
+	}
 
 	# Check the current folder syntax (must begin and start with a slash).
@@ -103,4 +93,7 @@
 	# Check for invalid folder paths (..)
 	if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) {
+		SendError( 102, "" ) ;
+	}
+	if ( $sCurrentFolder =~ /(\/\.)|[[:cntrl:]]|(\/\/)|(\\\\)|([\:\*\?\"\<\>\|])/ ) {
 		SendError( 102, "" ) ;
 	}
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/upload.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/upload.cgi	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/upload.cgi	(revision 3813)
@@ -25,5 +25,5 @@
 
 ##
-# ATTENTION: To enable this connector, look for the "SECURITY" comment in this file.
+# ATTENTION: To enable this connector, look for the "SECURITY" comment in config.pl.
 ##
 
@@ -59,52 +59,22 @@
 require 'commands.pl';
 require 'upload_fck.pl';
+require 'config.pl';
 
-##
-# SECURITY: REMOVE/COMMENT THE FOLLOWING LINE TO ENABLE THIS CONNECTOR.
-##
-	&SendUploadResults(1, '', '', 'This connector is disabled. Please check the "editor/filemanager/connectors/perl/upload.cgi" file' ) ;
-
-	&read_input();
-
-	if($FORM{'ServerPath'} ne "") {
-		$GLOBALS{'UserFilesPath'} = $FORM{'ServerPath'};
-		if(!($GLOBALS{'UserFilesPath'} =~ /\/$/)) {
-			$GLOBALS{'UserFilesPath'} .= '/' ;
-		}
-	} else {
-		$GLOBALS{'UserFilesPath'} = '/userfiles/';
-	}
-
-	# Map the "UserFiles" path to a local directory.
-	$rootpath = &GetRootPath();
-	$GLOBALS{'UserFilesDirectory'} = $rootpath . $GLOBALS{'UserFilesPath'};
-
-	&DoResponse();
+&read_input();
+&DoResponse();
 
 sub DoResponse
 {
 	# Get the main request information.
-	$sCommand		= 'FileUpload'; #$FORM{'Command'};
-	$sResourceType	= $FORM{'Type'};
-	$sCurrentFolder	= $FORM{'CurrentFolder'};
+	$sCommand		= 'FileUpload';
+	$sResourceType	= &specialchar_cnv($FORM{'Type'});
+	$sCurrentFolder	= "/";
 
 	if ($sResourceType eq '') {
 		$sResourceType = 'File' ;
 	}
-	if ($sCurrentFolder eq '') {
-		$sCurrentFolder = '/' ;
-	}
 
-	# Check the current folder syntax (must begin and start with a slash).
-	if(!($sCurrentFolder =~ /\/$/)) {
-		$sCurrentFolder .= '/';
-	}
-	if(!($sCurrentFolder =~ /^\//)) {
-		$sCurrentFolder = '/' . $sCurrentFolder;
-	}
-
-	# Check for invalid folder paths (..)
-	if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) {
-		SendError( 102, "" ) ;
+	if ( !($sResourceType =~ /^(File|Image|Flash|Media)$/) ) {
+		SendError( 1, "Invalid type specified" ) ;
 	}
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/util.pl
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/util.pl	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/util.pl	(revision 3813)
@@ -41,7 +41,5 @@
 {
 	local($value) = @_;
-	return $value;
-#	return utf8_encode(htmlspecialchars($value));
-
+	return(&specialchar_cnv($value));
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/basexml.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/basexml.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/basexml.php	(revision 3813)
@@ -66,4 +66,7 @@
 function SendError( $number, $text )
 {
+	if ( $_GET['Command'] == 'FileUpload' )
+		SendUploadResults( $number, "", "", $text ) ;
+
 	if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
 	{
@@ -89,5 +92,8 @@
 function SendErrorNode(  $number, $text )
 {
-	echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ;
+	if ($text)
+		echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ;
+	else
+		echo '<Error number="' . $number . '" />' ;
 }
 ?>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/commands.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/commands.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/commands.php	(revision 3813)
@@ -31,13 +31,15 @@
 	$aFolders	= array() ;
 
-	$oCurrentFolder = opendir( $sServerDir ) ;
-
-	while ( $sFile = readdir( $oCurrentFolder ) )
-	{
-		if ( $sFile != '.' && $sFile != '..' && is_dir( $sServerDir . $sFile ) )
-			$aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
-	}
-
-	closedir( $oCurrentFolder ) ;
+	$oCurrentFolder = @opendir( $sServerDir ) ;
+
+	if ($oCurrentFolder !== false)
+	{
+		while ( $sFile = readdir( $oCurrentFolder ) )
+		{
+			if ( $sFile != '.' && $sFile != '..' && is_dir( $sServerDir . $sFile ) )
+				$aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
+		}
+		closedir( $oCurrentFolder ) ;
+	}
 
 	// Open the "Folders" node.
@@ -61,27 +63,32 @@
 	$aFiles		= array() ;
 
-	$oCurrentFolder = opendir( $sServerDir ) ;
-
-	while ( $sFile = readdir( $oCurrentFolder ) )
-	{
-		if ( $sFile != '.' && $sFile != '..' )
-		{
-			if ( is_dir( $sServerDir . $sFile ) )
-				$aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
-			else
-			{
-				$iFileSize = @filesize( $sServerDir . $sFile ) ;
-				if ( !$iFileSize ) {
-					$iFileSize = 0 ;
-				}
-				if ( $iFileSize > 0 )
-				{
-					$iFileSize = round( $iFileSize / 1024 ) ;
-					if ( $iFileSize < 1 ) $iFileSize = 1 ;
-				}
-
-				$aFiles[] = '<File name="' . ConvertToXmlAttribute( $sFile ) . '" size="' . $iFileSize . '" />' ;
-			}
-		}
+	$oCurrentFolder = @opendir( $sServerDir ) ;
+
+	if ($oCurrentFolder !== false)
+	{
+		while ( $sFile = readdir( $oCurrentFolder ) )
+		{
+			if ( $sFile != '.' && $sFile != '..' )
+			{
+				if ( is_dir( $sServerDir . $sFile ) )
+					$aFolders[] = '<Folder name="' . ConvertToXmlAttribute( $sFile ) . '" />' ;
+				else
+				{
+					$iFileSize = @filesize( $sServerDir . $sFile ) ;
+					if ( !$iFileSize ) {
+						$iFileSize = 0 ;
+					}
+					if ( $iFileSize > 0 )
+					{
+						$iFileSize = round( $iFileSize / 1024 ) ;
+						if ( $iFileSize < 1 )
+							$iFileSize = 1 ;
+					}
+
+					$aFiles[] = '<File name="' . ConvertToXmlAttribute( $sFile ) . '" size="' . $iFileSize . '" />' ;
+				}
+			}
+		}
+		closedir( $oCurrentFolder ) ;
 	}
 
@@ -153,5 +160,5 @@
 
 	// Create the "Error" node.
-	echo '<Error number="' . $sErrorNumber . '" originalDescription="' . ConvertToXmlAttribute( $sErrorMsg ) . '" />' ;
+	echo '<Error number="' . $sErrorNumber . '" />' ;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/config.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/config.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/config.php	(revision 3813)
@@ -29,9 +29,4 @@
 //		authenticated users can access this file or use some kind of session checking.
 $Config['Enabled'] = false ;
-
-// @Packager.Remove.Start
-// Attention: In the development version (SVN) the PHP connector is enabled by default.
-$Config['Enabled'] = true ;
-// @Packager.Remove.End
 
 // Path to user files relative to the document root.
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/io.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/io.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/io.php	(revision 3813)
@@ -246,4 +246,7 @@
 		SendError( 102, '' ) ;
 
+	if ( preg_match(",(/\.)|[[:cntrl:]]|(//)|(\\\\)|([\:\*\?\"\<\>\|]),", $sCurrentFolder))
+		SendError( 102, '' ) ;
+
 	return $sCurrentFolder ;
 }
@@ -287,4 +290,9 @@
 EOF;
 
+	if ($errorNumber && $errorNumber != 201) {
+		$fileUrl = "";
+		$fileName = "";
+	}
+
 	$rpl = array( '\\' => '\\\\', '"' => '\\"' ) ;
 	echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ;
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/upload.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/upload.php	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/upload.php	(revision 3813)
@@ -44,5 +44,5 @@
 $sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
 
-$sCurrentFolder	= GetCurrentFolder() ;
+$sCurrentFolder	= "/" ;
 
 // Is enabled the upload?
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/connector.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/connector.py	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/connector.py	(revision 3813)
@@ -57,5 +57,8 @@
 		# Check for invalid paths
 		if currentFolder is None:
-			return self.sendError(102, "")
+			if (command == "FileUpload"):
+				return self.sendUploadResults( errorNo = 102, customMsg = "" )
+			else:
+				return self.sendError(102, "")
 
 		# Check if it is an allowed command
@@ -80,5 +83,5 @@
 		if not os.path.exists(self.userFilesFolder):
 			try:
-				self.createServerFoldercreateServerFolder( self.userFilesFolder )
+				self.createServerFolder( self.userFilesFolder )
 			except:
 				return self.sendError(1, "This connector couldn\'t access to local user\'s files directories.  Please check the UserFilesAbsolutePath in \"editor/filemanager/connectors/py/config.py\" and try again. ")
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckcommands.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckcommands.py	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckcommands.py	(revision 3813)
@@ -72,7 +72,11 @@
 			elif os.path.isfile(someObjectPath):
 				size = os.path.getsize(someObjectPath)
-				files += """<File name="%s" size="%s" />""" % (
+				if size > 0:
+					size = round(size/1024)
+					if size < 1:
+						size = 1
+				files += """<File name="%s" size="%d" />""" % (
 						convertToXmlAttribute(someObject),
-						os.path.getsize(someObjectPath)
+						size
 						)
 		# Close the folders / files node
@@ -164,5 +168,5 @@
 					if os.path.exists(newFilePath):
 						i += 1
-						newFileName = "%s(%04d).%s" % (
+						newFileName = "%s(%d).%s" % (
 								newFileNameOnly, i, newFileExtension
 								)
@@ -190,9 +194,9 @@
 								os.umask( oldumask )
 
-						newFileUrl = self.webUserFilesFolder + currentFolder + newFileName
+						newFileUrl = combinePaths(self.webUserFilesFolder, currentFolder) + newFileName
 
 						return self.sendUploadResults( errorNo , newFileUrl, newFileName )
 			else:
-				return self.sendUploadResults( errorNo = 203, customMsg = "Extension not allowed" )
+				return self.sendUploadResults( errorNo = 202, customMsg = "" )
 		else:
 			return self.sendUploadResults( errorNo = 202, customMsg = "No File" )
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckoutput.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckoutput.py	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckoutput.py	(revision 3813)
@@ -96,5 +96,8 @@
 
 	def sendErrorNode(self, number, text):
-		return """<Error number="%s" text="%s" />""" % (number, convertToXmlAttribute(text))
+		if number != 1:
+			return """<Error number="%s" />""" % (number)
+		else:
+			return """<Error number="%s" text="%s" />""" % (number, convertToXmlAttribute(text))
 
 class BaseHtmlMixin(object):
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckutil.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckutil.py	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckutil.py	(revision 3813)
@@ -63,5 +63,5 @@
 	"Do a cleanup of the folder name to avoid possible problems"
 	# Remove . \ / | : ? * " < > and control characters
-	return re.sub( '(?u)\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[^\u0000-\u001f\u007f-\u009f]', '_', newFolderName )
+	return re.sub( '\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[\x00-\x1f\x7f-\x9f]', '_', newFolderName )
 
 def sanitizeFileName( newFileName ):
@@ -69,9 +69,9 @@
 	# Replace dots in the name with underscores (only one dot can be there... security issue).
 	if ( Config.ForceSingleExtension ): # remove dots
-		newFileName = re.sub ( '/\\.(?![^.]*$)/', '_', newFileName ) ;
+		newFileName = re.sub ( '\\.(?![^.]*$)', '_', newFileName ) ;
 	newFileName = newFileName.replace('\\','/')		# convert windows to unix path
 	newFileName = os.path.basename (newFileName)	# strip directories
 	# Remove \ / | : ? *
-	return re.sub ( '(?u)/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[^\u0000-\u001f\u007f-\u009f]/', '_', newFileName )
+	return re.sub ( '\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[\x00-\x1f\x7f-\x9f]/', '_', newFileName )
 
 def getCurrentFolder(currentFolder):
@@ -91,4 +91,8 @@
 	# Check for invalid folder paths (..)
 	if '..' in currentFolder or '\\' in currentFolder:
+		return None
+
+	# Check for invalid folder paths (..)
+	if re.search( '(/\\.)|(//)|([\\\\:\\*\\?\\""\\<\\>\\|]|[\x00-\x1F]|[\x7f-\x9f])', currentFolder ):
 		return None
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/upload.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/upload.py	(revision 3812)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/upload.py	(revision 3813)
@@ -42,5 +42,5 @@
 		# The file type (from the QueryString, by default 'File').
 		resourceType  = self.request.get('Type','File')
-		currentFolder = getCurrentFolder(self.request.get("CurrentFolder",""))
+		currentFolder = "/"
 		# Check for invalid paths
 		if currentFolder is None:
