Skip to content

Commit

Permalink
Removes some unnecessary stuff in Utf8String::extractWords()
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
  • Loading branch information
Sesquipedalian committed Jul 27, 2024
1 parent f6be443 commit 2e19fa8
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions Sources/Unicode/Utf8String.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,25 +663,16 @@ public function extractWords(int $level): array
$original_string = $this->string;

// Replace any illegal entities with spaces.
$this->string = \SMF\Utils::sanitizeEntities($this->string, ' ');
$this->string = Utils::sanitizeEntities($this->string, ' ');

// Decode all the entities.
$this->string = \SMF\Utils::entityDecode($this->string, true, ENT_QUOTES | ENT_HTML5, true);
$this->string = Utils::entityDecode($this->string, true, ENT_QUOTES | ENT_HTML5, true);

// Replace unwanted invisible characters with spaces.
$this->sanitizeInvisibles($level, ' ');

// Normalize the whitespace.
$this->string = \SMF\Utils::normalizeSpaces($this->string, true, true, ['replace_tabs' => true, 'collapse_hspace' => true]);

// Sanitize variation selectors and join controls.
$placeholders = [];
$this->sanitizeVariationSelectors($placeholders, ' ');
$this->sanitizeJoinControls($placeholders, $level, ' ');

if (!empty($placeholders)) {
$this->string = strtr($this->string, array_flip($placeholders));
}
$this->string = Utils::normalizeSpaces($this->string, true, true, ['replace_tabs' => true, 'collapse_hspace' => true]);

// We'll need these one way or another.
require_once __DIR__ . '/RegularExpressions.php';
Expand Down

0 comments on commit 2e19fa8

Please sign in to comment.