Index: FCKeditor/trunk/editor/filemanager/connectors/php/io.php
===================================================================
--- FCKeditor/trunk/editor/filemanager/connectors/php/io.php	(revision 1635)
+++ FCKeditor/trunk/editor/filemanager/connectors/php/io.php	(revision 1648)
@@ -151,7 +151,7 @@
 function GetRootPath()
 {
-    if (!isset($_SERVER)) {
-        global $_SERVER;
-    }
+	if (!isset($_SERVER)) {
+		global $_SERVER;
+	}
 	$sRealPath = realpath( './' ) ;
 
@@ -224,12 +224,14 @@
 function GetCurrentFolder()
 {
-    if (!isset($_GET)) {
-        global $_GET;
-    }
+	if (!isset($_GET)) {
+		global $_GET;
+	}
 	$sCurrentFolder	= isset( $_GET['CurrentFolder'] ) ? $_GET['CurrentFolder'] : '/' ;
 
 	// Check the current folder syntax (must begin and start with a slash).
-	if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
-	if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
+	if ( !preg_match( '|/$|', $sCurrentFolder ) ) 
+		$sCurrentFolder .= '/' ;
+	if ( strpos( $sCurrentFolder, '/' ) !== 0 ) 
+		$sCurrentFolder = '/' . $sCurrentFolder ;
 
 	// Ensure the folder path has no double-slashes
@@ -251,5 +253,5 @@
 
 	// Remove . \ / | : ? * " < >
-	$sNewFolderName = preg_replace( '/\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>/', '_', $sNewFolderName ) ;
+	$sNewFolderName = preg_replace( '/\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFolderName ) ;
 
 	return $sNewFolderName ;
@@ -268,5 +270,5 @@
 
 	// Remove \ / | : ? * " < >
-	$sNewFileName = preg_replace( '/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>/', '_', $sNewFileName ) ;
+	$sNewFileName = preg_replace( '/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFileName ) ;
 
 	return $sNewFileName ;
