PHP Error

Undefined variable: ub

/var/www/vhosts/armasarquitectura/protected/helpers/HelperFunctions.php(530)

518         elseif(preg_match('/Opera/i',$u_agent))
519         {
520             $bname = 'Opera';
521             $ub = "Opera";
522         }
523         elseif(preg_match('/Netscape/i',$u_agent))
524         {
525             $bname = 'Netscape';
526             $ub = "Netscape";
527         }
528             
529         // finally get the correct version number
530         $known = array('Version', $ub, 'other');
531         $pattern = '#(?<browser>' . join('|', $known) .
532         ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
533         if (!preg_match_all($pattern, $u_agent, $matches)) {
534             // we have no matching number just continue
535         }
536             
537         // see how many we have
538         $i = count($matches['browser']);
539         if ($i != 1) {
540             //we will have two since we are not using 'other' argument yet
541             //see if version is before or after the name
542             if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){

Stack Trace

#0
+
 /var/www/vhosts/armasarquitectura/protected/models/Sessions.php(105): HelperFunctions::getBrowser()
100         $session = new Sessions;
101         $session->code = Yii::app()->session->sessionID;
102         $session->cookie = CookieHandler::get('main');
103         $session->ip = HelperFunctions::getIP();
104         if(!HelperFunctions::isBot($session->ip)){
105             $session->browser = HelperFunctions::getBrowser();
106             $session->referrer = substr(HelperFunctions::getReferrer(), 0, 256);
107             $session->created_on = HelperFunctions::getDate();
108             if ($session->ip != '192.252.218.60')
109                 if ($session->save()) {
110                     Yii::app()->session['set'] = true;
#1
+
 /var/www/vhosts/armasarquitectura/protected/components/Controller.php(57): Sessions::create()
52         
53         if (strlen(CookieHandler::get('main')) != 32) {
54             Cookies::create();
55         }
56         if (!isset(Yii::app()->session['set'])) {
57             Sessions::create();
58         }
59         if (isset($_GET['utm_content'])) {
60             MttSpaceVisits::create();
61         }
62         
#5
+
 /var/www/vhosts/armasarquitectura/public_html/index.php(27): CApplication->run()
22 defined('YII_DEBUG') or define('YII_DEBUG',true);
23 // specify how many levels of call stack should be shown in each log message
24 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
25 
26 require_once($yii);
27 Yii::createWebApplication($config)->run();
2024-03-28 15:24:06 Apache/2.4.39 (Amazon) OpenSSL/1.0.2k-fips PHP/7.0.27 Yii Framework/1.1.7