mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-19 07:07:58 +08:00
Fixes #12703: Fixed StringHelper::truncateHtml() non functional when dom PHP extension is disabled
This commit is contained in:
committed by
GitHub
parent
c33583aede
commit
210cf36750
@@ -154,7 +154,7 @@ class BaseStringHelper
|
||||
$config = \HTMLPurifier_Config::create(null);
|
||||
$config->set('Cache.SerializerPath', \Yii::$app->getRuntimePath());
|
||||
$lexer = \HTMLPurifier_Lexer::create($config);
|
||||
$tokens = $lexer->tokenizeHTML($string, $config, null);
|
||||
$tokens = $lexer->tokenizeHTML($string, $config, new \HTMLPurifier_Context());
|
||||
$openTokens = [];
|
||||
$totalCount = 0;
|
||||
$truncated = [];
|
||||
|
||||
Reference in New Issue
Block a user