FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

Update UploadBehavior.php to cast to int #506

Closed challgren closed 5 years ago

challgren commented 5 years ago

Fixes #505

ADmad commented 5 years ago

The file array is generated by PHP itself. I wonder how that value ended up being string instead of integer.

challgren commented 5 years ago

I'm using the following plugins and do have my models override Tools

$this->addPlugin('Datalist');
        $this->addPlugin('OrcaServices/Heartbeat');
        $this->addPlugin('Tools', ['routes' => false, 'bootstrap' => false]);
        $this->addPlugin('Queue', ['routes' => false]);
        $this->addPlugin('BryanCrowe/EncryptedType');
        $this->addPlugin('BootstrapUI');
        $this->addPlugin('CakeDC/Users');
        $this->addPlugin('Muffin/Footprint');
        $this->addPlugin('CakeImpersonate');
        $this->addPlugin('DataTables');
        $this->addPlugin('Mailgun');
        $this->addPlugin('AssetCompress');
        $this->addPlugin('Search');
        $this->addPlugin('Josegonzalez/Upload');
challgren commented 5 years ago

My components are

public function initialize()
    {
        parent::initialize();

        $this->loadComponent('RequestHandler', [
            'enableBeforeRedirect' => false,
        ]);
        $this->loadComponent('Flash');
        $this->loadComponent('Tools.Common');
        $this->loadComponent('CakeDC/Users.UsersAuth');
        $this->loadComponent('CakeImpersonate.Impersonate');
        //$this->loadComponent('Tools.Mobile', ['auto' => true]);
        $this->loadComponent('Search.Prg', [
            'actions' => ['index', 'lookup']
        ]);

        /*
         * Enable the following component for recommended CakePHP security settings.
         * see https://book.cakephp.org/3.0/en/controllers/components/security.html
         */
        //$this->loadComponent('Security');
    }