diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index ff20f28..a6e28df 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -598,6 +598,12 @@ function drupal_validate_utf8($text) {
  * equivalent using other environment variables.
  *
  * @todo The above comment is incorrect: http://drupal.org/node/1547294.
+ *
+ * NB This function is intended for limited use, in cases before the $container
+ * is available. Use $request->getRequestUri() whereever possible.
+ *
+ * @return string
+ *   The request URI
  */
 function request_uri($omit_query_string = FALSE) {
   if (isset($_SERVER['REQUEST_URI'])) {
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 6971718..1bacb11 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -866,10 +866,10 @@ protected function initializeRequestGlobals(Request $request) {
         // are in effect and the script path can be similarly dropped from URL
         // generation. For servers that don't provide $_SERVER['REQUEST_URI'],
         // we do not know the actual URI requested by the client, and
-        // request_uri() returns a URI with the script name, resulting in
+        // $request->getRequestUri() returns a URI with the script name, resulting in
         // non-clean URLs unless
         // there's other code that intervenes.
-        if (strpos(request_uri(TRUE) . '/', $base_path . $script_path) !== 0) {
+        if (strpos($request->getRequestUri(TRUE) . '/', $base_path . $script_path) !== 0) {
           $script_path = '';
         }
         // @todo Temporary BC for install.php, authorize.php, and other scripts.
diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php
index d16d851..a1bf7ec 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -301,7 +301,7 @@ public function rebuildForm($form_id, FormStateInterface &$form_state, $old_form
       $form['#build_id'] = 'form-' . Crypt::randomBytesBase64();
     }
 
-    // #action defaults to request_uri(), but in case of Ajax and other partial
+    // #action defaults to $request->getRequestUri(), but in case of Ajax and other partial
     // rebuilds, the form is submitted to an alternate URL, and the original
     // #action needs to be retained.
     if (isset($old_form['#action']) && !empty($rebuild_info['copy']['#action'])) {
@@ -534,7 +534,7 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state) {
 
     // Only update the action if it is not already set.
     if (!isset($form['#action'])) {
-      $form['#action'] = $this->requestUri();
+      $form['#action'] = $this->requestStack->getCurrentRequest()->getRequestUri();
     }
 
     // Fix the form method, if it is 'get' in $form_state, but not in $form.
@@ -1099,13 +1099,4 @@ protected function currentUser() {
     return $this->currentUser;
   }
 
-  /**
-   * Gets the current request URI.
-   *
-   * @return string
-   */
-  protected function requestUri() {
-    return request_uri();
-  }
-
 }
diff --git a/core/modules/dblog/src/Tests/DbLogTest.php b/core/modules/dblog/src/Tests/DbLogTest.php
index 72be622..2fed784 100644
--- a/core/modules/dblog/src/Tests/DbLogTest.php
+++ b/core/modules/dblog/src/Tests/DbLogTest.php
@@ -143,7 +143,7 @@ private function generateLogEntries($count, $type = 'custom', $severity = RfcLog
       'link'        => NULL,
       'user'        => $this->adminUser,
       'uid'         => $this->adminUser->id(),
-      'request_uri' => $base_root . request_uri(),
+      'request_uri' => $base_root . \Drupal::request()->getRequestUri(),
       'referer'     => \Drupal::request()->server->get('HTTP_REFERER'),
       'ip'          => '127.0.0.1',
       'timestamp'   => REQUEST_TIME,
@@ -452,7 +452,7 @@ protected function testDBLogAddAndClear() {
       'link'        => NULL,
       'user'        => $this->adminUser,
       'uid'         => $this->adminUser->id(),
-      'request_uri' => $base_root . request_uri(),
+      'request_uri' => $base_root . \Drupal::request()->getRequestUri(),
       'referer'     => \Drupal::request()->server->get('HTTP_REFERER'),
       'ip'          => '127.0.0.1',
       'timestamp'   => REQUEST_TIME,
diff --git a/core/modules/locale/src/LocaleLookup.php b/core/modules/locale/src/LocaleLookup.php
index 8aa1809..8accabc 100644
--- a/core/modules/locale/src/LocaleLookup.php
+++ b/core/modules/locale/src/LocaleLookup.php
@@ -12,6 +12,7 @@
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Lock\LockBackendInterface;
+use Symfony\Component\HttpFoundation\Request;
 
 /**
  * A cache collector to allow for dynamic building of the locale cache.
@@ -66,6 +67,13 @@ class LocaleLookup extends CacheCollector {
    * @var \Drupal\Core\Language\LanguageManagerInterface
    */
   protected $languageManager;
+  
+  /**
+   * The current request.
+   *
+   * @var \Symfony\Component\HttpFoundation\Request
+   */
+  protected $request;
 
   /**
    * Constructs a LocaleLookup object.
@@ -84,13 +92,16 @@ class LocaleLookup extends CacheCollector {
    *   The config factory.
    * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
    *   The language manager.
+   * @param \Symfony\Component\HttpFoundation\Request $request
+   *   The current request.
    */
-  public function __construct($langcode, $context, StringStorageInterface $string_storage, CacheBackendInterface $cache, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager) {
+  public function __construct($langcode, $context, StringStorageInterface $string_storage, CacheBackendInterface $cache, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager, Request $request) {
     $this->langcode = $langcode;
     $this->context = (string) $context;
     $this->stringStorage = $string_storage;
     $this->configFactory = $config_factory;
     $this->languageManager = $language_manager;
+    $this->request = $request;
 
     $this->cache = $cache;
     $this->lock = $lock;
@@ -178,10 +189,10 @@ protected function resolveCacheMiss($offset) {
   }
 
   /**
-   * Wraps request_uri().
+   * Wraps $request->getRequestUri().
    */
   protected function requestUri($omit_query_string = FALSE) {
-    return request_uri($omit_query_string);
+    return $this->getRequestUri($omit_query_string);
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
index 2386eb2..f9c4a6b 100644
--- a/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Form/FormTestBase.php
@@ -328,13 +328,6 @@ public function drupalStaticReset($name = NULL) {
     static::$seenIds = array();
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  protected function requestUri() {
-    return '';
-  }
-
 }
 
 }
