Skip to content

Commit

Permalink
fix: Fixed a regression in extractTextFromField that could cause it…
Browse files Browse the repository at this point in the history
… to not render properly by being more explicit, looking only for arrays or `Collections` in `isArrayLike()` ([#1441](#1441))
  • Loading branch information
khalwat committed Mar 26, 2024
1 parent fe6b149 commit 1f85b1f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/helpers/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace nystudio107\seomatic\helpers;

use ArrayAccess;
use benf\neo\elements\Block as NeoBlock;
use benf\neo\elements\db\BlockQuery as NeoBlockQuery;
use craft\elements\db\MatrixBlockQuery;
Expand All @@ -20,12 +19,12 @@
use craft\elements\Tag;
use craft\helpers\HtmlPurifier;
use craft\models\FieldLayout;
use Illuminate\Support\Collection;
use nystudio107\seomatic\helpers\Field as FieldHelper;
use nystudio107\seomatic\Seomatic;
use PhpScience\TextRank\TextRankFacade;
use PhpScience\TextRank\Tool\StopWords\StopWordsAbstract;
use Stringy\Stringy;
use Traversable;
use verbb\doxter\Doxter;
use verbb\doxter\fields\data\DoxterData;
use verbb\supertable\elements\db\SuperTableBlockQuery;
Expand Down Expand Up @@ -467,7 +466,7 @@ public static function cleanupText($text): string
*/
public static function isArrayLike($var): bool
{
return is_array($var) || ($var instanceof ArrayAccess && $var instanceof Traversable);
return is_array($var) || ($var instanceof Collection);
}

// Protected Static Methods
Expand Down

0 comments on commit 1f85b1f

Please sign in to comment.