Skip to content

Commit

Permalink
Fixes yiisoft#12703: Fixed StringHelper::truncateHtml() non functio…
Browse files Browse the repository at this point in the history
…nal when dom PHP extension is disabled
  • Loading branch information
samdark authored Dec 26, 2016
1 parent c33583a commit 210cf36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Yii Framework 2 Change Log
- Bug #11771: Fixed semantics of `yii\di\ServiceLocator::__isset()` to match the behavior of `__get()` which fixes inconsistent behavior on newer PHP versions (cebe)
- Bug #12213: Fixed `yii\db\ActiveRecord::unlinkAll()` to respect `onCondition()` of the relational query (silverfire)
- Bug #12681: Changed `data` column type from `text` to `blob` to handle null-byte (`\0`) in serialized RBAC rule properly (silverfire)
- Bug #12703: Fixed `StringHelper::truncateHtml()` non functional when dom PHP extension is disabled (samdark)
- Bug #12714: Fixed `yii\validation\EmailValidator` to prevent false-positives checks when property `checkDns` is set to `true` (silverfire)
- Bug #12735: Fixed `yii\console\controllers\MigrateController` creating multiple primary keys for field `bigPrimaryKey:unsigned` (SG5)
- Bug #12791: Fixed `yii\behaviors\AttributeTypecastBehavior` unable to automatically detect `attributeTypes`, triggering PHP Fatal Error (klimov-paul)
Expand Down
2 changes: 1 addition & 1 deletion framework/helpers/BaseStringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected static function truncateHtml($string, $count, $suffix, $encoding = fal
$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 = [];
Expand Down

0 comments on commit 210cf36

Please sign in to comment.