fixed I18n->translate(), username validation
This commit is contained in:
parent
798e274503
commit
812a84e9f8
@ -396,6 +396,8 @@
|
||||
if (!Config::ENABLE_USER_REGISTRATION || !$registration_enabled)
|
||||
return static::ERR_REGISTER_DISABLED;
|
||||
|
||||
$username = preg_replace("/\\W/", "_", strtolower($username));
|
||||
|
||||
// Check that user doesn't exist
|
||||
$user = $this->app->assets->getBySlug(
|
||||
"\\Crispage\\Assets\\User", $username
|
||||
|
@ -124,7 +124,7 @@
|
||||
$num = preg_match_all(self::TS_REGEX, $str, $matches, PREG_OFFSET_CAPTURE);
|
||||
|
||||
// If no keys, return the input
|
||||
if (!$num) return $str;
|
||||
if (!$num) return (empty($vars)) ? $str : sprintf($str, ...$vars);
|
||||
|
||||
// Initialize position and output variables
|
||||
$pos = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user