Error Drupal\Core\Entity\EntityStorageException: Untrusted Host
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #2961395. -->
Reported by: [seanb](https://www.drupal.org/user/545912)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When this module is enabled I get an <code>EntityStorageException</code> when trying to save an external link in a menu item. The error is:<br>
<em>Drupal\Core\Entity\EntityStorageException: Untrusted Host "<a href="http://www.external-link.com">www.external-link.com</a>". in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 829 of /htdocs/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).</em></p>
<p>I traced this to <code>\Drupal\menu_entity_index\Tracker::getRequestForUrl()</code>. In this method the module tries to create a request for the URL. When it's an external URL and you have <code>$settings['trusted_host_patterns']</code> set up in your <em>settings.php</em>, you are not allowed to do this request.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Check for external URL's and don't create a request if an external URL is detected.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue