fixing bugs in validator and file classes.
This commit is contained in:
parent
e226a463bf
commit
a6641130c4
|
@ -167,7 +167,10 @@ public static function is($extensions, $path)
|
||||||
{
|
{
|
||||||
$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 @@ protected function validate_confirmed($attribute, $value)
|
||||||
{
|
{
|
||||||
$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 @@ protected function validate_confirmed($attribute, $value)
|
||||||
*/
|
*/
|
||||||
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');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue