diff --git a/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php b/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php index fde3ffd..ebaea17 100644 --- a/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php +++ b/src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php @@ -62,7 +62,9 @@ class HttpFetcherFeedForm extends ExternalPluginFormBase implements ContainerInj $url = Feed::translateSchemes($form_state->getValue('source')); } catch (\InvalidArgumentException $e) { - $form_state->setError($form['source'], $this->t("The feed's scheme doesn't match a scheme recognized by this module. Accepted schemes are http, feed, webcal, https, feeds, and webcals.")); + $form_state->setError($form['source'], $this->t("The url's scheme is not supported. Supported schemes are: @supported.", [ + '@supported' => implode(', ', Feed::getSupportedSchemes()), + ])); // If the source doesn't have a valid scheme the rest of the validation // isn't helpful. Break out early. return; diff --git a/src/Utility/Feed.php b/src/Utility/Feed.php index 512f5d1..83006f9 100644 --- a/src/Utility/Feed.php +++ b/src/Utility/Feed.php @@ -124,4 +124,21 @@ class Feed { throw new \InvalidArgumentException(); } + /** + * Returns which url schemes are supported by Feeds. + * + * @return array + * The support schemes. + */ + public static function getSupportedSchemes() { + return [ + 'http', + 'feed', + 'webcal', + 'https', + 'feeds', + 'webcals', + ]; + } + }