Show
Ignore:
Timestamp:
2008-03-25 14:01:57 (8 months ago)
Author:
wwalc
Message:

Fix for #1944, backslash is disallowed in currentfolder parameter: ColdFusion, Perl, PHP, Python

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/filemanager/connectors/lasso/upload.lasso

    r1565 r1797  
    5757        ); 
    5858 
    59  
    6059        /*..................................................................... 
    6160        Custom tag sets the HTML response. 
     
    7877                $__html_reply__ = '\ 
    7978<script type="text/javascript"> 
     79(function() 
     80{ 
     81        var d = document.domain ; 
     82 
     83        while ( true ) 
     84        { 
     85                // Test if we can access a parent property. 
     86                try 
     87                { 
     88                        var test = window.top.opener.document.domain ; 
     89                        break ; 
     90                } 
     91                catch( e ) {} 
     92 
     93                // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 
     94                d = d.replace( /.*?(?:\\.|$)/, "" ) ; 
     95 
     96                if ( d.length == 0 ) 
     97                        break ;         // It was not able to detect the domain. 
     98 
     99                try 
     100                { 
     101                        document.domain = d ; 
     102                } 
     103                catch (e) 
     104                { 
     105                        break ; 
     106                } 
     107        } 
     108})() ; 
    80109        window.parent.OnUploadCompleted(' + #errorNumber + ',"' 
    81110                + string_replace(#fileUrl, -find='"', -replace='\\"') + '","' 
     
    86115        /define_tag; 
    87116 
     117        if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\')); 
     118                $errorNumber = 102; 
     119        /if; 
    88120 
    89121        if($config->find('Enabled')); 
     
    95127                        Was a file actually uploaded? 
    96128                        */ 
    97                         file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202; 
     129                        if($errorNumber != '102'); 
     130                                file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202; 
     131                        /if; 
    98132 
    99133                        if($errorNumber == 0);