Index: /FCKeditor/trunk/_whatsnew.html
===================================================================
--- /FCKeditor/trunk/_whatsnew.html	(revision 354)
+++ /FCKeditor/trunk/_whatsnew.html	(revision 355)
@@ -153,4 +153,7 @@
 			BUG-1721787</a>] If the editor is run from a virtual dir, the PHP connector will detect that
 			and avoid generating a wrong folder.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/431">#431</a>] PHP: The
+			File Browser now displays an error message when it is not able to created the configured
+			target directory for files (instead of sending broken XML responses).</li>
 	</ul>
 	<h3>
Index: /FCKeditor/trunk/editor/filemanager/browser/default/connectors/php/basexml.php
===================================================================
--- /FCKeditor/trunk/editor/filemanager/browser/default/connectors/php/basexml.php	(revision 354)
+++ /FCKeditor/trunk/editor/filemanager/browser/default/connectors/php/basexml.php	(revision 355)
@@ -55,4 +55,6 @@
 	// Add the current folder node.
 	echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder ) ) . '" />' ;
+
+	$GLOBALS['HeaderSent'] = true ;
 }
 
@@ -69,7 +71,16 @@
 	echo '<?xml version="1.0" encoding="utf-8" ?>' ;
 
-	echo '<Connector><Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" /></Connector>' ;
+	echo '<Connector>' ;
+	
+	SendErrorNode(  $number, $text ) ;
+	
+	echo '</Connector>' ;
 
 	exit ;
 }
+
+function SendErrorNode(  $number, $text )
+{
+	echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ;
+}
 ?>
Index: /FCKeditor/trunk/editor/filemanager/browser/default/connectors/php/io.php
===================================================================
--- /FCKeditor/trunk/editor/filemanager/browser/default/connectors/php/io.php	(revision 354)
+++ /FCKeditor/trunk/editor/filemanager/browser/default/connectors/php/io.php	(revision 355)
@@ -42,5 +42,18 @@
 
 	// Ensure that the directory exists.
-	CreateServerFolder( $sResourceTypePath ) ;
+	$sErrorMsg = CreateServerFolder( $sResourceTypePath ) ;
+	if ( $sErrorMsg != '' )
+	{
+		if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] )
+		{ 
+			SendErrorNode( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ;
+			CreateXmlFooter() ;
+			exit ;
+		}
+		else
+		{
+			SendError( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ;
+		}
+	}
 
 	// Return the resource type directory combined with the required path.
