From 57f94a78293ce1d8171344c8e2d2d958326ab1f6 Mon Sep 17 00:00:00 2001 From: crynobone Date: Sun, 6 May 2012 00:53:24 +0800 Subject: [PATCH] Validator: During replace :attribute, need to verify Lang::has('key') instead of checking is_null() Signed-off-by: crynobone --- laravel/validator.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/laravel/validator.php b/laravel/validator.php index b18bf512..dd3a15fd 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -946,17 +946,18 @@ protected function attribute($attribute) // of the attribute name in the message. $line = "{$bundle}validation.attributes.{$attribute}"; - $display = Lang::line($line)->get($this->language); + if (Lang::has($line, $this->language)) + { + return Lang::line($line)->get($this->language); + } // If no language line has been specified for the attribute, all of // the underscores are removed from the attribute name and that // will be used as the attribtue name. - if (is_null($display)) + else { return str_replace('_', ' ', $attribute); } - - return $display; } /**