Plugin Directory

Changeset 2452008


Ignore:
Timestamp:
01/07/2021 03:18:08 PM (5 years ago)
Author:
themexa
Message:

v2.6 - Security nonces added and verified

Location:
secure-file-manager/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • secure-file-manager/trunk/includes/assets.php

    r2035139 r2452008  
    1717        return;
    1818    }
     19
     20    $sfmp_nonce_key = wp_create_nonce( 'secure-file-manager-pro' );
    1921
    2022    wp_enqueue_style( 'sfm-admin-normalize',  plugin_dir_url( dirname( __FILE__ ) ) . 'assets/admin/css/normalize.css' );
     
    4042    wp_localize_script('sfm-admin-vendor-script', 'elfScript', array(
    4143        'pluginsDirUrl' => plugin_dir_url( dirname( __FILE__ ) ),
     44        'sfmpNonceKey' => $sfmp_nonce_key
    4245    ));
    4346    wp_enqueue_script( 'sfm-admin-script',  plugin_dir_url( dirname( __FILE__ ) ) . 'assets/admin/js/plugin-admin-script.js' );
  • secure-file-manager/trunk/readme.txt

    r2329924 r2452008  
    44Donate link: https://www.themexa.com
    55Requires at least: 4.0
    6 Tested up to: 5.4.2
    7 Requires PHP: 5.6
    8 Stable tag: 2.5
     6Tested up to: 5.6
     7Requires PHP: 7.1
     8Stable tag: 2.6
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    111111* Compatible with WordPress 5.4.2
    112112
     113= 2.6 =
     114* Security nonces added to AJAX requests
     115
    113116== Upgrade Notice ==
    114117= 1.0 =
  • secure-file-manager/trunk/secure-file-manager.php

    r2329924 r2452008  
    33/**
    44 * @package Secure File Manager
    5  * @version 2.5
     5 * @version 2.6
    66 */
    77
     
    1111Description: Most Beautiful and Secure WordPress File Manager
    1212Author: Themexa
    13 Version: 2.5
     13Version: 2.6
    1414Author URI: https://www.themexa.com
    1515License: GPL2
  • secure-file-manager/trunk/vendor/elfinder/js/script.js

    r2034949 r2452008  
    66                cssAutoLoad : false,               // Disable CSS auto loading
    77                baseUrl : './',                    // Base URL to css/*, js/*
    8                 url : elfScript.pluginsDirUrl + '/vendor/elfinder/php/connector.minimal.php'
     8                url : elfScript.pluginsDirUrl + '/vendor/elfinder/php/connector.minimal.php',
     9                customData : {_wpnonce: elfScript.sfmpNonceKey },
    910                // , lang: 'ru'                    // language (OPTIONAL)
    1011            },
  • secure-file-manager/trunk/vendor/elfinder/php/connector.minimal.php

    r2240484 r2452008  
    259259function runConnector() {
    260260
     261    $nonce = $_REQUEST['_wpnonce'];
     262
     263    if ( wp_verify_nonce( $nonce, 'secure-file-manager-pro' ) ){
     264        $connectorOptions = array(
     265            'driver'     => 'LocalFileSystem',
     266            'path'       => getcwd().'../../../../../../../',
     267            'startPath'  => getcwd().'../../../../../../../',
     268            'URL'        => dirname($_SERVER['PHP_SELF']) . '/../files/',
     269            'trashHash'  => 't1_Lw',                     // elFinder's hash of trash folder
     270            'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
     271            'mimeDetect' => 'internal',
     272            'tmbPath'    => '.tmb',
     273            'utf8fix'    => true,
     274            'tmbCrop'    => false,
     275            'tmbBgColor' => 'transparent',
     276            'accessControl' => 'access',
     277            'acceptedName'    => '/^[^\.].*$/',
     278            'attributes' => array(
     279                array(
     280                    'pattern' => '/\.js$/',
     281                    'read' => true,
     282                    'write' => false
     283                ),
     284                array(
     285                    'pattern' => '/^\/icons$/',
     286                    'read' => true,
     287                    'write' => false
     288                )
     289            ),
     290            'uploadDeny'  => array('all'),                // All Mimetypes not allowed to upload
     291            'uploadAllow' => array('image/x-ms-bmp', 'image/gif', 'image/jpeg', 'image/png', 'image/x-icon', 'text/plain', 'text/x-php', 'application/zip', 'application/pdf', 'text/css'), // Mimetype `image` and `text/plain` allowed to upload
     292            'uploadOrder' => array('deny', 'allow'),      // allowed Mimetype `image` and `text/plain` only
     293        );
     294    } else {
     295        $connectorOptions = array(
     296            'driver'     => 'LocalFileSystem',
     297            'path'       => getcwd().'../../../../../../../',
     298            'startPath'  => getcwd().'../../../../../../../',
     299            'URL'        => dirname($_SERVER['PHP_SELF']) . '/../files/',
     300            'trashHash'  => 't1_Lw',                     // elFinder's hash of trash folder
     301            'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
     302            'mimeDetect' => 'internal',
     303            'tmbPath'    => '.tmb',
     304            'utf8fix'    => true,
     305            'tmbCrop'    => false,
     306            'tmbBgColor' => 'transparent',
     307            'accessControl' => 'access',
     308            'acceptedName'    => '/^[^\.].*$/',
     309            'disabled' => array('abort','archive','callback','chmod','dim','duplicate','editor','extract','file','get','info','ls','mkdir','mkfile','netmount','open','parents','paste','ping','put','rename','resize','rm','search','size','tmb','tree','upload','url','zipdl'),
     310            'attributes' => array(
     311                array(
     312                    'pattern' => '/\.js$/',
     313                    'read' => true,
     314                    'write' => false
     315                ),
     316                array(
     317                    'pattern' => '/^\/icons$/',
     318                    'read' => true,
     319                    'write' => false
     320                )
     321            ),
     322            'uploadDeny'  => array('all'),                // All Mimetypes not allowed to upload
     323            'uploadAllow' => array('image/x-ms-bmp', 'image/gif', 'image/jpeg', 'image/png', 'image/x-icon', 'text/plain', 'text/x-php', 'application/zip', 'application/pdf', 'text/css'), // Mimetype `image` and `text/plain` allowed to upload
     324            'uploadOrder' => array('deny', 'allow'),      // allowed Mimetype `image` and `text/plain` only
     325        );
     326    }
     327
    261328    $opts = array(
    262329        'locale' => 'en_US.UTF-8',
     
    268335        'netVolumesSessionKey' => 'netVolumes',
    269336        'roots' => array(
    270             array(
    271                 'driver'     => 'LocalFileSystem',
    272                 'path'       => getcwd().'../../../../../../../',
    273                 'startPath'  => getcwd().'../../../../../../../',
    274                 'URL'        => dirname($_SERVER['PHP_SELF']) . '/../files/',
    275                 'trashHash'  => 't1_Lw',                     // elFinder's hash of trash folder
    276                 'winHashFix' => DIRECTORY_SEPARATOR !== '/', // to make hash same to Linux one on windows too
    277                 // 'treeDeep'   => 3,
    278                 // 'alias'      => 'File system',
    279                 'mimeDetect' => 'internal',
    280                 'tmbPath'    => '.tmb',
    281                 'utf8fix'    => true,
    282                 'tmbCrop'    => false,
    283                 'tmbBgColor' => 'transparent',
    284                 'accessControl' => 'access',
    285                 'acceptedName'    => '/^[^\.].*$/',
    286                 // 'disabled' => array('extract', 'archive'),
    287                 // 'tmbSize' => 128,
    288                 'attributes' => array(
    289                     array(
    290                         'pattern' => '/\.js$/',
    291                         'read' => true,
    292                         'write' => false
    293                     ),
    294                     array(
    295                         'pattern' => '/^\/icons$/',
    296                         'read' => true,
    297                         'write' => false
    298                     )
    299                 ),
    300                 'uploadDeny'  => array('all'),                // All Mimetypes not allowed to upload
    301                 'uploadAllow' => array('image/x-ms-bmp', 'image/gif', 'image/jpeg', 'image/png', 'image/x-icon', 'text/plain', 'text/x-php', 'application/zip', 'application/pdf', 'text/css'), // Mimetype `image` and `text/plain` allowed to upload
    302                 'uploadOrder' => array('deny', 'allow'),      // allowed Mimetype `image` and `text/plain` only
    303             ),
     337            $connectorOptions,
    304338            // Trash volume
    305339            array(
Note: See TracChangeset for help on using the changeset viewer.