File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
app/code/core/Mage/Core/Model/Design Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -672,15 +672,16 @@ protected function _checkUserAgentAgainstRegexps($regexpsConfigPath)
672
672
public static function getPackageByUserAgent (array $ rules , $ regexpsConfigPath = 'path_mock ' )
673
673
{
674
674
foreach ($ rules as $ rule ) {
675
- if (!empty (self ::$ _regexMatchCache [$ rule ['regexp ' ]][$ _SERVER ['HTTP_USER_AGENT ' ]])) {
675
+ $ userAgent = $ _SERVER ['HTTP_USER_AGENT ' ] ?? '' ;
676
+ if (!empty (self ::$ _regexMatchCache [$ rule ['regexp ' ]][$ userAgent ])) {
676
677
self ::$ _customThemeTypeCache [$ regexpsConfigPath ] = $ rule ['value ' ];
677
678
return $ rule ['value ' ];
678
679
}
679
680
680
681
$ regexp = '/ ' . trim ($ rule ['regexp ' ], '/ ' ) . '/ ' ;
681
682
682
- if (@preg_match ($ regexp , $ _SERVER [ ' HTTP_USER_AGENT ' ] )) {
683
- self ::$ _regexMatchCache [$ rule ['regexp ' ]][$ _SERVER [ ' HTTP_USER_AGENT ' ] ] = true ;
683
+ if (@preg_match ($ regexp , $ userAgent )) {
684
+ self ::$ _regexMatchCache [$ rule ['regexp ' ]][$ userAgent ] = true ;
684
685
self ::$ _customThemeTypeCache [$ regexpsConfigPath ] = $ rule ['value ' ];
685
686
return $ rule ['value ' ];
686
687
}
You can’t perform that action at this time.
0 commit comments