{"action":"closed","issue":{"url":"https://api.github.com/repos/zendframework/zendframework/issues/6926","repository_url":"https://api.github.com/repos/zendframework/zendframework","labels_url":"https://api.github.com/repos/zendframework/zendframework/issues/6926/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zendframework/issues/6926/comments","events_url":"https://api.github.com/repos/zendframework/zendframework/issues/6926/events","html_url":"https://github.com/zendframework/zendframework/issues/6926","id":50084029,"number":6926,"title":"Zend\\Validator\\File\\Count warning","user":{"login":"googlle","id":2455916,"avatar_url":"https://avatars.githubusercontent.com/u/2455916?v=3","gravatar_id":"","url":"https://api.github.com/users/googlle","html_url":"https://github.com/googlle","followers_url":"https://api.github.com/users/googlle/followers","following_url":"https://api.github.com/users/googlle/following{/other_user}","gists_url":"https://api.github.com/users/googlle/gists{/gist_id}","starred_url":"https://api.github.com/users/googlle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlle/subscriptions","organizations_url":"https://api.github.com/users/googlle/orgs","repos_url":"https://api.github.com/users/googlle/repos","events_url":"https://api.github.com/users/googlle/events{/privacy}","received_events_url":"https://api.github.com/users/googlle/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zendframework/zendframework/labels/awaiting%20author%20updates","name":"awaiting author updates","color":"e11d21"},{"url":"https://api.github.com/repos/zendframework/zendframework/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/zendframework/zendframework/labels/To%20Be%20Closed","name":"To Be Closed","color":"eb6420"},{"url":"https://api.github.com/repos/zendframework/zendframework/labels/Validator","name":"Validator","color":"008000"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2014-11-25T21:08:28Z","updated_at":"2016-06-27T14:37:22Z","closed_at":"2016-06-27T14:37:22Z","body":"Warning: dirname() expects parameter 1 to be string, array given in C:\\wamp\\www\\application\\vendor\\zendframework\\zendframework\\library\\Zend\\Validator\\File\\Count.php on line 204\r\n\r\n```php\r\n    \t$fileInput = new \\Zend\\InputFilter\\FileInput('image');\r\n\t$fileInput->setRequired(true);\r\n\t$fileInput->getValidatorChain()\r\n\t\t\t->attach(new \\Zend\\Validator\\File\\UploadFile(), true)\r\n\t\t\t->attach(new \\Zend\\Validator\\File\\Size(array('max' => '5MB')), true)\r\n\t\t\t->attach(new \\Zend\\Validator\\File\\Extension(array('png,jpeg,jpg,gif,tiff')), true)\r\n\t\t\t->attach(new \\Zend\\Validator\\File\\MimeType(array('mimeType' => 'image/png,image/x-png,image/gif,image/jpeg,image/pjpeg', 'enableHeaderCheck' => true)), true)\r\n\t\t\t->attach(new \\Zend\\Validator\\File\\ImageSize(array('maxWidth' => 1024, 'maxHeight' => 768)))\r\n\t\t\t->attach(new \\Zend\\Validator\\File\\IsImage(true))\r\n\t\t\t->attach(new \\Zend\\Validator\\File\\Count(array('max' => 1)), true);\r\n\t\r\n\t$fileInput->getFilterChain()->attach(new \\Zend\\Filter\\File\\RenameUpload(array(\r\n\t\t\t'options' => array(\r\n\t\t\t\t'target' => './public/uploads/preview/avatar',\r\n\t\t\t\t'use_upload_name'      => false,\r\n\t\t\t\t'use_upload_extension' => true,\r\n\t\t\t\t'overwrite'            => false,\r\n\t\t\t\t'randomize' => true,\r\n\t\t\t)\r\n\t\t))\r\n\t);\r\n\r\n    public function isValid($value, $file = null)\r\n    {\r\n        if (($file !== null) && !array_key_exists('destination', $file)) {\r\n            $file['destination'] = dirname($value);   //204 line\r\n            \r\n            var_dump($value);\r\n        }\r\n\r\n        if (($file !== null) && array_key_exists('tmp_name', $file)) {\r\n            $value = $file['destination'] . DIRECTORY_SEPARATOR . $file['name'];\r\n        }\r\n\r\n        if (($file === null) || !empty($file['tmp_name'])) {\r\n            $this->addFile($value);\r\n        }\r\n\r\n        $this->count = count($this->files);\r\n        if (($this->getMax() !== null) && ($this->count > $this->getMax())) {\r\n            return $this->throwError($file, self::TOO_MANY);\r\n        }\r\n\r\n        if (($this->getMin() !== null) && ($this->count < $this->getMin())) {\r\n            return $this->throwError($file, self::TOO_FEW);\r\n        }\r\n\r\n        return true;\r\n    }\r\n\r\narray (size=5)  'name' => string 'image.jpg' (length=9)  'type' => string 'image/jpeg' (length=10)  'tmp_name' => string 'C:\\wamp\\tmp\\php8F50.tmp' (length=23)  'error' => int 0  'size' => int 77081\r\n```"}}
{"actor":{"display_login":"GeeH"}}