mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 06:37:55 +08:00 
			
		
		
		
	@ -38,8 +38,8 @@ class ApiIndexer extends Indexer
 | 
				
			|||||||
            $description = strip_tags($matches[1]);
 | 
					            $description = strip_tags($matches[1]);
 | 
				
			||||||
        } elseif (preg_match('~<p>(.*?)</p>~s', $contents, $matches)) {
 | 
					        } elseif (preg_match('~<p>(.*?)</p>~s', $contents, $matches)) {
 | 
				
			||||||
            $description = strip_tags($matches[1]);
 | 
					            $description = strip_tags($matches[1]);
 | 
				
			||||||
            if (mb_strlen($description) > 1000) { // TODO truncate by words
 | 
					            if (mb_strlen($description, 'UTF-8') > 1000) { // TODO truncate by words
 | 
				
			||||||
                $description = mb_substr($description, 0, 1000) . '...';
 | 
					                $description = mb_substr($description, 0, 1000, 'UTF-8') . '...';
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $description = '';
 | 
					            $description = '';
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user