File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -145,8 +145,13 @@ public static function toAscii(string $s): string
145145 {
146146 $ iconv = defined ('ICONV_IMPL ' ) ? trim (ICONV_IMPL , '" \'' ) : null ;
147147 static $ transliterator = null ;
148- if ($ transliterator === null && class_exists ('Transliterator ' , false )) {
149- $ transliterator = \Transliterator::create ('Any-Latin; Latin-ASCII ' );
148+ if ($ transliterator === null ) {
149+ if (class_exists ('Transliterator ' , false )) {
150+ $ transliterator = \Transliterator::create ('Any-Latin; Latin-ASCII ' );
151+ } else {
152+ trigger_error (__METHOD__ . "(): it is recommended to enable PHP extensions 'intl'. " , E_USER_NOTICE );
153+ $ transliterator = false ;
154+ }
150155 }
151156
152157 // remove control characters and check UTF-8 validity
You can’t perform that action at this time.
0 commit comments