From 75050b93debebe4164707ef14edd3776f9b2ed32 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Thu, 8 Jun 2023 14:11:42 +0300 Subject: [PATCH] - fixed PHP errors; --- includes/core/class-fonticons.php | 33 +++++++++++++++++-------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/includes/core/class-fonticons.php b/includes/core/class-fonticons.php index 6d964a23..9d7abd74 100644 --- a/includes/core/class-fonticons.php +++ b/includes/core/class-fonticons.php @@ -1,42 +1,47 @@ $file ) { - $css = file_get_contents( $file ); - if ( $c == 'fa' ) { - preg_match_all('/\.(um-faicon-.*?):before/', $css, $matches); + if ( 'fa' === $c ) { + preg_match_all( '/\.(um-faicon-.*?):before/', $css, $matches ); } else { - preg_match_all('/\.(um-icon-.*?):before/', $css, $matches); + preg_match_all( '/\.(um-icon-.*?):before/', $css, $matches ); } foreach ( $matches[1] as $match ) { - $icon = str_replace( ':before', '', $match ); + $icon = str_replace( ':before', '', $match ); $array[] = $icon; } $array = array_unique( $array ); @@ -45,9 +50,7 @@ if ( ! class_exists( 'um\core\FontIcons' ) ) { update_option( 'um_cache_fonticons', $array ); } - $this->all = get_option( 'um_cache_fonticons' ); - + $this->all = $cached_option; } - } -} \ No newline at end of file +}