diff --git a/core/modules/views/src/Plugin/views/display/PathPluginBase.php b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
index f3d90ce..ed170cb 100644
--- a/core/modules/views/src/Plugin/views/display/PathPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/PathPluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Plugin\views\display;
 
+use Drupal\Component\Utility\UrlHelper;
 use Drupal\Core\Access\AccessManagerInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Routing\UrlGeneratorTrait;
@@ -449,6 +450,16 @@ protected function validatePath($path) {
       $errors[] = $this->t('"%" may not be used for the first segment of a path.');
     }
 
+    $a = UrlHelper::parse($path);
+
+    if (empty($a['path'])) {
+      $errors[] = $this->t('Path is empty.');
+    }
+
+    if (!empty($a['query'])) {
+      $errors[] = $this->t('No path query allowed.');
+    }
+
     $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 3f79d64..2ca96cb 100644
--- a/core/modules/views_ui/src/Tests/DisplayPathTest.php
+++ b/core/modules/views_ui/src/Tests/DisplayPathTest.php
@@ -92,8 +92,24 @@ public function testMenuOptions() {
 
     // Add a new page display.
     $this->drupalPostForm(NULL, array(), 'Add Page');
+
+    // Add an invalid path (empty just fragment).
+    $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => '#foo'), t('Apply'));
+    $this->assertText('Path is empty');
+
+    // Add a path with a query.
+    $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => 'foo?bar'), t('Apply'));
+    $this->assertText('No path query allowed.');
+
+    // Add a path with just a query.
+    $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => '?bar'), t('Apply'));
+    $this->assertText('Path is empty');
+
+    // Provide a valid path string.
+    $random_string = str_replace(['?', '#'], '_', $this->randomString());
+
     // Save a path.
-    $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => $this->randomString()), t('Apply'));
+    $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/path', array('path' => $random_string), t('Apply'));
     $this->drupalGet('admin/structure/views/view/test_view');
 
     $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_1/menu', array('menu[type]' => 'default tab', 'menu[title]' => 'Test tab title'), t('Apply'));
