PHP notice

Undefined offset: -1

/home/apache/organization/www/protected/components/OrganizationUrlRule.php(116)

104             $newurl = str_replace("oldurl=auto", "", $url);
105             $request->redirect($newurl, TRUE, 301);
106         }
107 
108         $exploded=explode('/',$pathInfo);
109         $explodedCount=count($exploded);
110 
111         if(!$explodedCount || $exploded[0]==='admin')
112             return false;
113                 
114         if($exploded[$explodedCount-1]=='price')
115         {
116             $category_alias = $exploded[$explodedCount-5];
117             $category=Yii::app()->db->createCommand()
118                 ->select('id, lft, rgt')
119                 ->from('organization_category')
120                 ->where("`alias` = '".$category_alias."' AND `level` = '2'")
121                 ->queryRow(); 
122 
123             $subcategory_alias = $exploded[$explodedCount-4];
124             $subcategory=Yii::app()->db->createCommand()
125                 ->select('id')
126                 ->from('organization_category')
127                 ->where("`alias` = '".$subcategory_alias."' AND `level` = '3' AND `lft` >= '".$category['lft']."' AND rgt <= '".$category['rgt']."'")
128                 ->queryRow(); 

Stack Trace

#3
+
 /home/apache/organization/www/index.php(26): CApplication->run()
21 $config='protected/config/main.php';
22 define('DEV_MODE',($_SERVER['SERVER_NAME']=='127.0.0.1' || $_SERVER['SERVER_NAME'] == "organization.ns3.handyhosting.ru"));
23 $yii=DEV_MODE ? '../../yii-framework/yii-1.1.13/yii.php':'../../yii-framework/yii-1.1.13/yiilite.php';
24 define('YII_DEBUG',true);
25 require($yii);
26 Yii::createWebApplication($config)->run();
2024-03-29 17:15:52 Apache/2.2.15 (CentOS) Yii Framework/1.1.13