diff --git a/laravel/file.php b/laravel/file.php index 8a4d6f24..afd4bd2e 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -167,7 +167,10 @@ public static function is($extensions, $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; diff --git a/laravel/validator.php b/laravel/validator.php index bf6259f3..57f57688 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -225,9 +225,7 @@ protected function validate_confirmed($attribute, $value) { $confirmed = $attribute.'_confirmation'; - $confirmation = $this->attributes[$confirmed]; - - return array_key_exists($confirmed, $this->attributes) and $value == $confirmation; + return isset($this->attributes[$confirmed]) and $value == $this->attributes[$confirmed]; } /** @@ -241,7 +239,7 @@ protected function validate_confirmed($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'); } /**