Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

I saw following code inĀ kPasswordFormatter code recently:

$error_msg = '+' . sprintf($this->Application->Phrase($phrase_error_prefix . '_passwords_too_short'), $min_length); // + -> not phrase
$object->SetError($password_field, 'passwords_min_length', $error_msg);

This code can be simplified becauseĀ kDBItem::SetError method already supports substitutions in error messages (phrases or not):

$object->SetError($password_field, 'passwords_min_length', $phrase_error_prefix . '_passwords_too_short', array($min_length));
  • No labels