PHP Error

Undefined variable: ub

/var/www/vhosts/milburnltda/protected/helpers/HelperFunctions.php(662)

650         elseif(preg_match('/Opera/i',$u_agent))
651         {
652             $bname = 'Opera';
653             $ub = "Opera";
654         }
655         elseif(preg_match('/Netscape/i',$u_agent))
656         {
657             $bname = 'Netscape';
658             $ub = "Netscape";
659         }
660             
661         // finally get the correct version number
662         $known = array('Version', $ub, 'other');
663         $pattern = '#(?<browser>' . join('|', $known) .
664         ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
665         if (!preg_match_all($pattern, $u_agent, $matches)) {
666             // we have no matching number just continue
667         }
668             
669         // see how many we have
670         $i = count($matches['browser']);
671         if ($i != 1) {
672             //we will have two since we are not using 'other' argument yet
673             //see if version is before or after the name
674             if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){

Stack Trace

#0
+
 /var/www/vhosts/milburnltda/protected/models/Sessions.php(106): HelperFunctions::getBrowser()
101         $session = new Sessions;
102         $session->code = Yii::app()->session->sessionID;
103         $session->cookie = CookieHandler::get('main');
104         $session->ip = HelperFunctions::getIP();
105         if(!HelperFunctions::isBot($session->ip)){
106             $session->browser = HelperFunctions::getBrowser();
107             $session->referrer = substr(HelperFunctions::getReferrer(), 0, 256);
108             $session->created_on = HelperFunctions::getDate();
109             if ($session->ip != '192.252.218.60'){
110                 $session->validate();
111                 if ($session->save()) {
#1
+
 /var/www/vhosts/milburnltda/protected/components/Controller.php(54): Sessions::create()
49             $this->isMobile = HelperFunctions::isMobileBrowser();
50            
51             if (strlen(CookieHandler::get('main')) != 32)
52                 Cookies::create();
53             if (!isset(Yii::app()->session['set']))
54                 Sessions::create();
55 
56             if (isset(Yii::app()->session['session_admin_id'])) {
57                 $this->administrator = Administrators::getCurrentAdministrator();
58             }
59         } catch (Exception $ex) {
#5
+
 /var/www/vhosts/milburnltda/public_html/index.php(12): CApplication->run()
07 defined('YII_DEBUG') or define('YII_DEBUG',true);
08 // specify how many levels of call stack should be shown in each log message
09 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
10 
11 require_once($yii);
12 Yii::createWebApplication($config)->run();
2024-03-28 14:30:06 Apache/2.4.39 (Amazon) OpenSSL/1.0.2k-fips PHP/7.0.27 Yii Framework/1.1.7