Changeset 355

Show
Ignore:
Timestamp:
2007-06-03 13:43:12 (20 months ago)
Author:
fredck
Message:

Fixed #431 : 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).

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/filemanager/browser/default/connectors/php/basexml.php

    r132 r355  
    5555        // Add the current folder node. 
    5656        echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder ) ) . '" />' ; 
     57 
     58        $GLOBALS['HeaderSent'] = true ; 
    5759} 
    5860 
     
    6971        echo '<?xml version="1.0" encoding="utf-8" ?>' ; 
    7072 
    71         echo '<Connector><Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" /></Connector>' ; 
     73        echo '<Connector>' ; 
     74         
     75        SendErrorNode(  $number, $text ) ; 
     76         
     77        echo '</Connector>' ; 
    7278 
    7379        exit ; 
    7480} 
     81 
     82function SendErrorNode(  $number, $text ) 
     83{ 
     84        echo '<Error number="' . $number . '" text="' . htmlspecialchars( $text ) . '" />' ; 
     85} 
    7586?> 
  • FCKeditor/trunk/editor/filemanager/browser/default/connectors/php/io.php

    r353 r355  
    4242 
    4343        // Ensure that the directory exists. 
    44         CreateServerFolder( $sResourceTypePath ) ; 
     44        $sErrorMsg = CreateServerFolder( $sResourceTypePath ) ; 
     45        if ( $sErrorMsg != '' ) 
     46        { 
     47                if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] ) 
     48                {  
     49                        SendErrorNode( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ; 
     50                        CreateXmlFooter() ; 
     51                        exit ; 
     52                } 
     53                else 
     54                { 
     55                        SendError( 1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})" ) ; 
     56                } 
     57        } 
    4558 
    4659        // Return the resource type directory combined with the required path. 
  • FCKeditor/trunk/_whatsnew.html

    r353 r355  
    153153                        BUG-1721787</a>] If the editor is run from a virtual dir, the PHP connector will detect that 
    154154                        and avoid generating a wrong folder.</li> 
     155                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/431">#431</a>] PHP: The 
     156                        File Browser now displays an error message when it is not able to created the configured 
     157                        target directory for files (instead of sending broken XML responses).</li> 
    155158        </ul> 
    156159        <h3>