Commit a6641130 authored by Taylor Otwell's avatar Taylor Otwell

fixing bugs in validator and file classes.

parent e226a463
...@@ -167,7 +167,10 @@ class File { ...@@ -167,7 +167,10 @@ class File {
{ {
$mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path); $mime = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);
if (isset($mimes[$extension]) and in_array((array) $mimes[$extension])) return true; if (isset($mimes[$extension]) and in_array($mime, (array) $mimes[$extension]))
{
return true;
}
} }
return false; return false;
......
...@@ -225,9 +225,7 @@ class Validator { ...@@ -225,9 +225,7 @@ class Validator {
{ {
$confirmed = $attribute.'_confirmation'; $confirmed = $attribute.'_confirmation';
$confirmation = $this->attributes[$confirmed]; return isset($this->attributes[$confirmed]) and $value == $this->attributes[$confirmed];
return array_key_exists($confirmed, $this->attributes) and $value == $confirmation;
} }
/** /**
...@@ -241,7 +239,7 @@ class Validator { ...@@ -241,7 +239,7 @@ class Validator {
*/ */
protected function validate_accepted($attribute, $value) protected function validate_accepted($attribute, $value)
{ {
return $this->validate_required($attribute) and ($value == 'yes' or $value == '1'); return $this->validate_required($attribute, $value) and ($value == 'yes' or $value == '1');
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment