This repository was archived by the owner on Dec 11, 2020. It is now read-only.
Commit 5bc0bbb 1 parent fb45001 commit 5bc0bbb Copy full SHA for 5bc0bbb
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,16 @@ public function userName()
94
94
$ username = static ::bothify ($ this ->generator ->parse ($ format ));
95
95
96
96
$ username = strtolower (static ::transliterate ($ username ));
97
- $ username = rtrim ($ username , '. ' );
98
97
99
98
// check if transliterate() didn't support the language and removed all letters
100
99
if (preg_match ('/^[._]*$/ ' , $ username )) {
101
100
throw new \Exception ('userName failed with the selected locale. Try a different locale or activate the "intl" PHP extension. ' );
102
101
}
103
102
103
+ // clean possible trailing dots from first/last names
104
+ $ username = str_replace ('.. ' , '. ' , $ username );
105
+ $ username = rtrim ($ username , '. ' );
106
+
104
107
return $ username ;
105
108
}
106
109
/**
@@ -129,13 +132,15 @@ public function domainWord()
129
132
$ lastName = $ this ->generator ->format ('lastName ' );
130
133
131
134
$ lastName = strtolower (static ::transliterate ($ lastName ));
132
- $ lastName = rtrim ($ lastName , '. ' );
133
135
134
136
// check if transliterate() didn't support the language and removed all letters
135
137
if (preg_match ('/^[._]*$/ ' , $ lastName )) {
136
138
throw new \Exception ('domainWord failed with the selected locale. Try a different locale or activate the "intl" PHP extension. ' );
137
139
}
138
140
141
+ // clean possible trailing dot from last name
142
+ $ lastName = rtrim ($ lastName , '. ' );
143
+
139
144
return $ lastName ;
140
145
}
141
146
You can’t perform that action at this time.
0 commit comments