PHP Error

Undefined variable: ub

/var/www/vhosts/cliwery/protected/helpers/HelperFunctions.php(350)

338         elseif(preg_match('/Opera/i',$u_agent))
339         {
340             $bname = 'Opera';
341             $ub = "Opera";
342         }
343         elseif(preg_match('/Netscape/i',$u_agent))
344         {
345             $bname = 'Netscape';
346             $ub = "Netscape";
347         }
348             
349         // finally get the correct version number
350         $known = array('Version', $ub, 'other');
351         $pattern = '#(?<browser>' . join('|', $known) .
352         ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
353         if (!preg_match_all($pattern, $u_agent, $matches)) {
354             // we have no matching number just continue
355         }
356             
357         // see how many we have
358         $i = count($matches['browser']);
359         if ($i != 1) {
360             //we will have two since we are not using 'other' argument yet
361             //see if version is before or after the name
362             if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){

Stack Trace

#0
+
 /var/www/vhosts/cliwery/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/cliwery/protected/components/Controller.php(37): Sessions::create()
32         public function init() {
33             if (strlen(CookieHandler::get('main')) != 32) {
34                 Cookies::create();
35             }
36             if (!isset(Yii::app()->session['set'])) {
37                 Sessions::create();
38             }
39             if (isset($_GET['utm_content'])) {
40                 MttSpaceVisits::create();
41             }
42         }
#5
+
 /var/www/vhosts/cliwery/public_html/index.php(28): CApplication->run()
23 defined('YII_DEBUG') or define('YII_DEBUG',true);
24 // specify how many levels of call stack should be shown in each log message
25 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
26 
27 require_once($yii);
28 Yii::createWebApplication($config)->run();
2024-03-29 08:50:27 Apache/2.4.39 (Amazon) OpenSSL/1.0.2k-fips PHP/7.0.27 Yii Framework/1.1.7