{"action":"created","issue":{"url":"https://api.github.com/repos/fuel/core/issues/2005","repository_url":"https://api.github.com/repos/fuel/core","labels_url":"https://api.github.com/repos/fuel/core/issues/2005/labels{/name}","comments_url":"https://api.github.com/repos/fuel/core/issues/2005/comments","events_url":"https://api.github.com/repos/fuel/core/issues/2005/events","html_url":"https://github.com/fuel/core/issues/2005","id":164187693,"number":2005,"title":"Bug: Validation min_length doesn't catch empty value","user":{"login":"glOOmyART","id":5780454,"avatar_url":"https://avatars.githubusercontent.com/u/5780454?v=3","gravatar_id":"","url":"https://api.github.com/users/glOOmyART","html_url":"https://github.com/glOOmyART","followers_url":"https://api.github.com/users/glOOmyART/followers","following_url":"https://api.github.com/users/glOOmyART/following{/other_user}","gists_url":"https://api.github.com/users/glOOmyART/gists{/gist_id}","starred_url":"https://api.github.com/users/glOOmyART/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glOOmyART/subscriptions","organizations_url":"https://api.github.com/users/glOOmyART/orgs","repos_url":"https://api.github.com/users/glOOmyART/repos","events_url":"https://api.github.com/users/glOOmyART/events{/privacy}","received_events_url":"https://api.github.com/users/glOOmyART/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-06T22:17:22Z","updated_at":"2016-07-06T22:22:43Z","closed_at":"2016-07-06T22:22:43Z","body":"Version 1.8 and 1.7.3 don't catch empty fields when validating against min_length which it should because empty value is defnitely below min_length.\r\n\r\ncore/classes/validation.php\r\n(line 796 for 1.7.3 and line 806 for 1.8)\r\n\r\npublic function _validation_min_length($val, $length)\r\n{\r\n\treturn $this->_empty($val) || \\Str::length($val) >= $length;\r\n}\r\n\r\nshould be\r\n\r\npublic function _validation_min_length($val, $length)\r\n{\r\n\treturn ! $this->_empty($val) || \\Str::length($val) >= $length;\r\n}\r\n\r\nto catch empty value\r\n\r\ni changed it in the 1.8 version i'm currently using and it catches empty values too now...\r\n"},"comment":{"url":"https://api.github.com/repos/fuel/core/issues/comments/230925191","html_url":"https://github.com/fuel/core/issues/2005#issuecomment-230925191","issue_url":"https://api.github.com/repos/fuel/core/issues/2005","id":230925191,"user":{"login":"stevewest","id":2370734,"avatar_url":"https://avatars.githubusercontent.com/u/2370734?v=3","gravatar_id":"","url":"https://api.github.com/users/stevewest","html_url":"https://github.com/stevewest","followers_url":"https://api.github.com/users/stevewest/followers","following_url":"https://api.github.com/users/stevewest/following{/other_user}","gists_url":"https://api.github.com/users/stevewest/gists{/gist_id}","starred_url":"https://api.github.com/users/stevewest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevewest/subscriptions","organizations_url":"https://api.github.com/users/stevewest/orgs","repos_url":"https://api.github.com/users/stevewest/repos","events_url":"https://api.github.com/users/stevewest/events{/privacy}","received_events_url":"https://api.github.com/users/stevewest/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T22:22:43Z","updated_at":"2016-07-06T22:22:43Z","body":"\"Empty\" values should be checked for with the `required` rule. You should add both `min_length` and `required` to the field to get the functionality that you want."}}
{"actor":{"display_login":"stevewest"}}