mailto:alexander.rettig@igd.fhg.de
Version 1.3.9-p1:
When entering a valid email address on the standard page
UserPreferences, I get two errors:
1)
lib/WikiUserNew.php (In template 'browse') (In template 'body')
(In template 'html'):2357: Warning[512]: ValidateMail: 1 is not
properly formatted
2)
lib/WikiDB/backend/PearDB.php (In template 'browse') (In
template 'body') (In template 'html'):765: Fatal[256]:
wikidb_backend_mysql: fatal database error
DB Error: syntax error
(1 [nativecode=1064 ** You have an error in your SQL syntax
near '1' at line 1])
I will only address the first one here, since I didn't find a
starting point to track the second one yet.
I tracked the cause of the first error down a little; that's what
I guess is the problem: It's the special way 'email' and
'emailVerified' "preferences" are handled: the preference
'emailVerified' has no corresponding _UserPreference_XXX
object but is handled by _UserPreference_email. But he
interface of the latter one (and of all classes derived from
_UserPreference) - the functions sanify() and update() - don't
distinguish whether they are called with a value for
'emailVerified' or 'email' - thus, when they are called by
_UserPreference::set('emailVerified',1),
_UserPreference_email::sanify tries to validate '1' as email
address.
I tried to reimplement set() in _UserPreference_email, but
surely this is a hack. I'd say, the concept of set/sanify/update
for _UserPreference_XXX with more than one value is not well
designed.
The reimplementation is ugly too (what shows a flaw in the
concept I think), but it avoids the first error:
(_UserPreference_email::)
function set ($name, $value) {
$return = 0;
if ($name == 'email')
$value = $this->sanify($value);
if ($name == 'email' and $this->get($name) != $value) { $this->update($value); $return = 1; } if ($value != $this->default_value) { $this->{$name} = $value; } else { unset($this->{$name}); } return $return; }
Logged In: YES
user_id=13755
True,
but I had with seperate obejcts before and had more problems.
I'll fix this asap.