diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
index 754408c..5e62eac 100644
--- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
@@ -15,6 +15,7 @@
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\Routing\RouteCompiler;
 use Drupal\Core\Routing\RouteProviderInterface;
+use Drupal\Core\Url;
 use Drupal\views\Views;
 
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -460,6 +461,10 @@ protected function validatePath($path) {
       $errors[] = $this->t('No query allowed.');
     }
 
+    if (!parse_url('base://' . $path)) {
+      $errors[] = $this->t('Invalid path, see <a href="@url">Spec</a>', ['@url' => 'http://www.faqs.org/rfcs/rfc3986.html']);
+    }
+
     $path_sections = explode('/', $path);
     // Symfony routing does not allow to use numeric placeholders.
     // @see \Symfony\Component\Routing\RouteCompiler
diff --git a/core/modules/views_ui/src/Tests/DisplayPathTest.php b/core/modules/views_ui/src/Tests/DisplayPathTest.php
index f174e6a..b8c0440 100644
--- a/core/modules/views_ui/src/Tests/DisplayPathTest.php
+++ b/core/modules/views_ui/src/Tests/DisplayPathTest.php
@@ -105,8 +105,12 @@ public function testMenuOptions() {
     $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => '?bar'), t('Apply'));
     $this->assertText('Path is empty');
 
+    // Add an invalid path from a random test failure.
+    $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => 'AKI@&hO@'), t('Apply'));
+    $this->assertText('Invalid path');
+
     // Provide a random, valid path string.
-    $random_string = str_replace(['?', '#'], '_', $this->randomString());
+    $random_string = $this->randomMachineName();
 
     // Save a path.
     $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => $random_string), t('Apply'));
