Ticket #1871: 1871.patch

File 1871.patch, 2.3 KB (added by Wiktor Walc, 12 years ago)
  • editor/filemanager/connectors/php/commands.php

     
    219219
    220220                                        if ( is_file( $sFilePath ) )
    221221                                        {
     222                                                if ( isset( $Config['ChmodOnUpload'] ) && !$Config['ChmodOnUpload'] )
     223                                                {
     224                                                        break ;
     225                                                }
     226                                               
     227                                                $permissions = 0777;
     228                                               
     229                                                if ( isset( $Config['ChmodOnUpload'] ) && $Config['ChmodOnUpload'] )
     230                                                {
     231                                                        $permissions = $Config['ChmodOnUpload'] ;
     232                                                }
     233                                               
    222234                                                $oldumask = umask(0) ;
    223                                                 chmod( $sFilePath, 0777 ) ;
     235                                                chmod( $sFilePath, $permissions ) ;
    224236                                                umask( $oldumask ) ;
    225237                                        }
    226238
  • editor/filemanager/connectors/php/config.php

     
    4747// following setting enabled.
    4848$Config['ForceSingleExtension'] = true ;
    4949
    50 // Perform additional checks for image files
    51 // if set to true, validate image size (using getimagesize)
     50// Perform additional checks for image files.
     51// If set to true, validate image size (using getimagesize).
    5252$Config['SecureImageUploads'] = true;
    5353
    54 // What the user can do with this connector
     54// What the user can do with this connector.
    5555$Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder') ;
    5656
    57 // Allowed Resource Types
     57// Allowed Resource Types.
    5858$Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media') ;
    5959
    6060// For security, HTML is allowed in the first Kb of data for files having the
    6161// following extensions only.
    6262$Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js") ;
    6363
     64// After file is uploaded, sometimes it is required to change its permissions
     65// so that it was possible to access it at the later time.
     66// If possible, it is recommended to set more restrictive permissions, like 0755.
     67// Set to 0 to disable this feature.
     68// Note: not needed on Windows-based servers.
     69$Config['ChmodOnUpload'] = 0777 ;
    6470/*
    6571        Configuration settings for each Resource Type
    6672
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy