PHP warning

strpos(): Offset not contained in string

/var/www/kvint/protected/components/Controller.php(273)

261         $info .= (($perms & 0x0002) ? 'w' : '-');
262         $info .= (($perms & 0x0001) ?
263             (($perms & 0x0200) ? 't' : 'x' ) :
264             (($perms & 0x0200) ? 'T' : '-'));
265 
266         return $info;
267     }
268 
269     public function crop($text,$dn=3){
270 
271         $pos=0;
272         for($i=0;$i<$dn;$i++){
273             $pos=strpos (strip_tags($text),'.',$pos+1);
274         }
275         if($pos===false){
276             $pos=strlen(strip_tags($text));
277         }
278         return substr(strip_tags($text),0, $pos+1);
279     }
280 
281   public function spliceTags($data){
282       $tags=array();
283       if(strpos($data,',')){
284           $tags =array_map('trim', explode(',', $data));
285       }else{

Stack Trace

#0
+
 /var/www/kvint/protected/components/Controller.php(273): strpos("", ".", 1)
268 
269     public function crop($text,$dn=3){
270 
271         $pos=0;
272         for($i=0;$i<$dn;$i++){
273             $pos=strpos (strip_tags($text),'.',$pos+1);
274         }
275         if($pos===false){
276             $pos=strlen(strip_tags($text));
277         }
278         return substr(strip_tags($text),0, $pos+1);
#1
+
 /var/www/kvint/protected/views/site/search_result.php(53): Controller->crop("", 3)
48 //                            $Model = Catalog::model()->findByPk($item['id'])
49                             ?>
50                             <div class="titlePosition">
51                                 <a href="<?= CHtml::normalizeUrl($item->newUrl()) ?>"><?= $item['title'] ?></a>
52                             </div>
53                             <div class="descPosition"><?= $this->crop(strip_tags($item['full_descr']), 3) ?></div>
54                         </li>
55                     <? endforeach; ?>
56                     <? foreach ($News as $item): ?>
57                         <li>
58                             <div class="titlePosition">
#6
+
 /var/www/kvint/protected/controllers/SiteController.php(576): CController->render("search_result", array("query" => "Hardware balancer", "items" => array(Catalog), "News" => array(), "Articles" => array()))
571         $criteria = new CDbCriteria();
572         $criteria->addSearchCondition('title',$query,true,'OR');
573         $criteria->addSearchCondition('text',$query,true,'OR');
574         $criteria->addSearchCondition('tags',$query,true,'OR');
575         $data['Articles'] = Articles::model()->cache(60*60*5)->findAll( $criteria );
576         $this->render('search_result',$data);
577     }
578 }
2024-03-29 18:59:18 Apache/2.2.15 (CentOS) Yii Framework/1.1.14