@@ -403,20 +403,20 @@ private function seporate_linkmods_and_icons_from_classes( $classes, &$linkmod_c
403403 foreach ( $ classes as $ key => $ class ) {
404404 // If any special classes are found, store the class in it's
405405 // holder array and and unset the item from $classes.
406- if ( preg_match ( '/disabled|sr-only/ ' , $ class ) ) {
406+ if ( preg_match ( '/^ disabled|^ sr-only/ ' , $ class ) ) {
407407 // Test for .disabled or .sr-only classes.
408408 $ linkmod_classes [] = $ class ;
409409 unset( $ classes [ $ key ] );
410- } elseif ( preg_match ( '/dropdown-header|dropdown-divider/ ' , $ class ) && $ depth > 0 ) {
410+ } elseif ( preg_match ( '/^ dropdown-header|^ dropdown-divider/ ' , $ class ) && $ depth > 0 ) {
411411 // Test for .dropdown-header or .dropdown-divider and a
412412 // depth greater than 0 - IE inside a dropdown.
413413 $ linkmod_classes [] = $ class ;
414414 unset( $ classes [ $ key ] );
415- } elseif ( preg_match ( '/fa-(\S*)?|fas(\s?)|far(\s?)|fal(\s?)|fab(\s?)|fa (\s?)/ ' , $ class ) ) {
415+ } elseif ( preg_match ( '/^ fa-(\S*)?|^fa(s|r|l|b)? (\s?)?$ / ' , $ class ) ) {
416416 // Font Awesome.
417417 $ icon_classes [] = $ class ;
418418 unset( $ classes [ $ key ] );
419- } elseif ( preg_match ( '/glyphicons -(\S*)?|glyphicons (\s?)/ ' , $ class ) ) {
419+ } elseif ( preg_match ( '/^glyphicon -(\S*)?|^glyphicon (\s?)$ / ' , $ class ) ) {
420420 // Glyphicons.
421421 $ icon_classes [] = $ class ;
422422 unset( $ classes [ $ key ] );
0 commit comments