From 1472caab764c2d95f38050b09cd78b487db7a35d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 12 Mar 2006 23:53:54 +0000 Subject: [PATCH] Allow strings to be returned as errors in set()-based verification --- api.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/api.php b/api.php index 19fb408..69cc335 100644 --- a/api.php +++ b/api.php @@ -275,9 +275,16 @@ class API $verify = $this->{$this->fields["$field"][F_VERIFY]}($field); } - if (!$verify) + if ($verify !== true) { - $this->error(sprintf($this->registry->modules['localize']->string('Validation of %1$s failed'), $field)); + if ($verify === false) + { + $this->error(sprintf($this->registry->modules['localize']->string('Validation of %1$s failed'), $field)); + } + else + { + $this->error($verify); + } } } } -- 2.22.5