Tweaked Input::has to check for empty strings. Deprecated Input::filled.
This commit is contained in:
@@ -17,18 +17,7 @@ class Input {
|
|||||||
*/
|
*/
|
||||||
public static function has($key)
|
public static function has($key)
|
||||||
{
|
{
|
||||||
return ( ! is_null(static::get($key)));
|
return ( ! is_null(static::get($key)) and trim((string) static::get($key)) !== '');
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if the input data contains an item that is not empty.
|
|
||||||
*
|
|
||||||
* @param string $key
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public static function filled($key)
|
|
||||||
{
|
|
||||||
return (static::has($key) and trim((string) static::get($key)) !== '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,18 +45,7 @@ class Input {
|
|||||||
*/
|
*/
|
||||||
public static function had($key)
|
public static function had($key)
|
||||||
{
|
{
|
||||||
return ( ! is_null(static::old($key)));
|
return ( ! is_null(static::old($key)) and trim((string) static::old($key)) !== '');
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determine if the old input data contains an item that is not empty.
|
|
||||||
*
|
|
||||||
* @param string $key
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public static function was_filled($key)
|
|
||||||
{
|
|
||||||
return (static::had($key) and trim((string) static::old($key)) !== '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user