From 52390c4a63f1a1d48b01a0fae24127d2f7658fec Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 15 Jun 2011 11:34:09 -0700 Subject: [PATCH] Added ability to pass multiple items to Input::has_old. --- system/input.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/system/input.php b/system/input.php index 20f593bb..095ca2e5 100644 --- a/system/input.php +++ b/system/input.php @@ -45,14 +45,21 @@ class Input { } /** - * Determine if the old input data contains an item. + * Determine if the old input data contains an item or set of items. * - * @param string $key * @return bool */ - public static function has_old($key) + public static function has_old() { - return ( ! is_null(static::old($key))); + foreach (func_get_args() as $key) + { + if (is_null($value = static::old($key)) or trim((string) $value) == '') + { + return false; + } + } + + return true; } /**