Commit 91ac966d authored by andrei.dincu's avatar andrei.dincu
Browse files

Issue #2249723 by andrei.dincu: Replace valid_url() with UrlHelper::isValid()

parent de7ce76b
......@@ -10,11 +10,12 @@ namespace Drupal\xmlsitemap_engines_test\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Drupal\Component\Utility\UrlHelper;
class XmlSitemapEnginesTestController extends ControllerBase {
public function render() {
if (empty($_GET['sitemap']) || !valid_url($_GET['sitemap'])) {
if (empty($_GET['sitemap']) || !UrlHelper::isValid($_GET['sitemap'])) {
watchdog('xmlsitemap', 'No valid sitemap parameter provided.', array(), WATCHDOG_WARNING);
// @todo Remove this? Causes an extra watchdog error to be handled.
throw new NotFoundHttpException();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment