diff --git a/core/modules/system/src/Plugin/Condition/RequestPath.php b/core/modules/system/src/Plugin/Condition/RequestPath.php
index a5f5613..11789d0 100644
--- a/core/modules/system/src/Plugin/Condition/RequestPath.php
+++ b/core/modules/system/src/Plugin/Condition/RequestPath.php
@@ -141,9 +141,11 @@ public function evaluate() {
 
     $request = $this->requestStack->getCurrentRequest();
     // Compare the lowercase path alias (if any) and internal path.
-    // @todo Remove dependency on the internal _system_path attribute:
-    //   https://www.drupal.org/node/2293581.
-    $path = $request->attributes->get('_system_path');
+    $path = \Drupal::urlGenerator()->getPathFromRoute(
+      \Drupal::routeMatch()->getRouteName(),
+      \Drupal::routeMatch()->getRawParameters()->all()
+    );
+
     $path_alias = Unicode::strtolower($this->aliasManager->getAliasByPath($path));
 
     return $this->pathMatcher->matchPath($path_alias, $pages) || (($path != $path_alias) && $this->pathMatcher->matchPath($path, $pages));
diff --git a/core/modules/views/src/Plugin/views/argument_default/Raw.php b/core/modules/views/src/Plugin/views/argument_default/Raw.php
index 022d029..0070a8b 100644
--- a/core/modules/views/src/Plugin/views/argument_default/Raw.php
+++ b/core/modules/views/src/Plugin/views/argument_default/Raw.php
@@ -90,9 +90,11 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
   }
 
   public function getArgument() {
-    // @todo Remove dependency on the internal _system_path attribute:
-    //   https://www.drupal.org/node/2293581.
-    $path = $this->view->getRequest()->attributes->get('_system_path');
+    $path = \Drupal::urlGenerator()->getPathFromRoute(
+      \Drupal::routeMatch()->getRouteName(),
+      \Drupal::routeMatch()->getRawParameters()->all()
+    );
+
     if ($this->options['use_alias']) {
       $path = $this->aliasManager->getAliasByPath($path);
     }
