File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,11 +30,11 @@ public function findAndReplace(string $string): string
3030
3131 public function locateCharactersInString (string $ string ): array
3232 {
33- preg_match_all ("/[^ \x00 - \x7F ]/u " , $ string , $ matches );
33+ preg_match_all ("/[^ -~ ]/u " , $ string , $ matches );
3434
3535 $ characters = [];
3636 foreach ($ matches [0 ] as $ match ) {
37- if (!in_array ($ match , $ characters )) {
37+ if (trim ( $ match ) && !in_array ($ match , $ characters )) {
3838 $ characters [] = $ match ;
3939 }
4040 }
@@ -46,7 +46,7 @@ public function convertArrayToRtf(array $strings): array
4646 {
4747 $ convertedStrings = [];
4848 foreach ($ strings as $ string ) {
49- if (!array_key_exists ($ string , $ convertedStrings )) {
49+ if (trim ( $ string ) && !array_key_exists ($ string , $ convertedStrings )) {
5050 $ convertedStrings [$ string ] = $ this ->convertStringToRtf ($ string );
5151 }
5252 }
You can’t perform that action at this time.
0 commit comments