Skip to content

Commit 5300a2b

Browse files
committed
Fix initals with removing special characters
1 parent 817823d commit 5300a2b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/InitialAvatar.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ public function generate( $name = null ) {
369369
public function generateSvg( $name = null ) {
370370
if ( $name !== null ) {
371371
$this->name = $name;
372-
$this->generated_initials = $this->initials_generator->keepCase( $this->getKeepCase() )->generate( $name );
372+
$this->generated_initials = $this->initials_generator->keepCase( $this->getKeepCase() )
373+
->allowSpecialCharacters( $this->getAllowSpecialCharacters() )
374+
->generate( $name );
373375
}
374376

375377
return $this->makeSvgAvatar();
@@ -381,7 +383,10 @@ public function generateSvg( $name = null ) {
381383
* @return string
382384
*/
383385
public function getInitials() {
384-
return $this->initials_generator->keepCase( $this->getKeepCase() )->name( $this->name )->getInitials();
386+
return $this->initials_generator->keepCase( $this->getKeepCase() )
387+
->allowSpecialCharacters( $this->getAllowSpecialCharacters() )
388+
->name( $this->name )
389+
->getInitials();
385390
}
386391

387392
/**

0 commit comments

Comments
 (0)