0

I am using this configuration for my Elfinder to use with CKEditor.

$opts = array(
    // 'debug' => true,
    'roots' => array(
        array(
            'driver'        => 'LocalFileSystem',   // driver for accessing file system (REQUIRED)
            'path'          => '../../uploads/',         // path to files (REQUIRED)
            'URL'           => dirname($_SERVER['PHP_SELF']) . '/../../uploads/', // URL to files (REQUIRED)
            'accessControl' => 'access'  ,           // disable and hide dot starting files (OPTIONAL)
            'uploadAllow' => array('image/jpg', 'image/png'),
            'alias'      => 'Home',
            'mimeDetect' => 'internal',
            'imgLib'     => 'gd',
        ),


    ),


);

However, I am able to upload all the files even PHP files!! I only want images to be uploaded. I am not able to restrict the uploading. Where am I going wrong?

Lajos Veres
  • 13,595
  • 7
  • 43
  • 56
Sankalp Singha
  • 4,461
  • 5
  • 39
  • 58
  • 'mimeDetect' => 'internal' means extension based file type checking. So you should be able to upload *.jpg with php content, but you should not enable to upload *.php. – Lajos Veres Oct 28 '13 at 18:59
  • I am able to upload PHP.. Like I said. I am able to upload everything!! :/ – Sankalp Singha Oct 28 '13 at 19:23

1 Answers1

5

Add:

'uploadOrder'=> array( 'allow', 'deny' )

Without this the default policy is allow if none of them matches.

According to: https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options#wiki-uploadOrder

Lajos Veres
  • 13,595
  • 7
  • 43
  • 56