PHP warning

mb_strpos(): Offset not contained in string

/home/talalkozasokhaza/public_html/protected/extensions/extra.php(119)

107            return $mail->Send();                     
108             
109     }
110     
111     public static function getIntro($text, $limit = 50)
112     {
113             $text = html_entity_decode($text, ENT_COMPAT , 'UTF-8'  );
114                                     
115             $intro = strip_tags($text);
116                                     
117             if(strlen($intro) > ($limit + 5)){
118                 
119                 $end = mb_strpos($intro, ' ', ($limit - 3), 'UTF-8');
120                 if($end == false || $end >= ($limit + 5))
121                     $end = $limit;
122                 
123                 $return = mb_substr($intro, 0, $end, 'UTF-8');
124                 
125                 return trim($return). '...';
126                 
127             } else {
128                 return trim($intro);    
129             }
130     }
131     

Stack Trace

#0
+
 /home/talalkozasokhaza/public_html/protected/extensions/extra.php(119): mb_strpos("A Tiszavasvári Általános Iskola diákjai adtak ünnepi műsor...", " ", 197, "UTF-8")
114                                     
115             $intro = strip_tags($text);
116                                     
117             if(strlen($intro) > ($limit + 5)){
118                 
119                 $end = mb_strpos($intro, ' ', ($limit - 3), 'UTF-8');
120                 if($end == false || $end >= ($limit + 5))
121                     $end = $limit;
122                 
123                 $return = mb_substr($intro, 0, $end, 'UTF-8');
124                 
#1
+
 /home/talalkozasokhaza/public_html/protected/controllers/PostController.php(64): extra::getIntro("<p>A Tiszavasv&aacute;ri &Aacute;ltal&aacute;nos Iskola di&aacut...", 200)
59    {
60       $model=$this->loadModel($_GET['id']);
61       
62       $this->pageTitle = $model->title;
63                         
64          Meta::renderMeta(extra::getIntro($model->content, 200), $model->tags);
65          
66         Post::model()->updateCounters(array('visited'=>1), array('condition'=>'id='.$model->id));
67             
68       $this->render('view',array(
69             'model'=>$model,
#14
+
 /home/talalkozasokhaza/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
14 
15 ?>
2024-03-29 08:42:27 Apache Yii Framework/1.1.10