Skip to content

Commit

Permalink
chore: do not index selects ,inputs and labels
Browse files Browse the repository at this point in the history
  • Loading branch information
runepiper committed Mar 7, 2024
1 parent d6cbb97 commit bb376f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/Domain/Model/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ public static function createFromTSFE(TypoScriptFrontendController $tsfe): Docum
preg_match('/<body>(.*?)<\/body>/s', $tsfe->content, $content);
}

// Remove code that shouldn't be indexed
$content = preg_replace('/<select(.*?)<\/select>/s', '', $content);
$content = preg_replace('/<input(.*?)\/>/s', '', $content);
$content = preg_replace('/<label(.*?)\/label>/s', '', $content);
$content = preg_replace('/<svg(.*?)\/svg>/s', '', $content);

// Remove query and fragments from URL
$uri = $tsfe->cObj->getRequest()->getUri();
$url = $uri->getScheme() . '://' . $uri->getAuthority();
Expand Down

0 comments on commit bb376f6

Please sign in to comment.