diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index fcf4d44..2f063d5 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -486,35 +486,6 @@ function drupal_validate_utf8($text) {
 }
 
 /**
- * Returns the equivalent of Apache's $_SERVER['REQUEST_URI'] variable.
- *
- * Because $_SERVER['REQUEST_URI'] is only available on Apache, we generate an
- * equivalent using other environment variables.
- *
- * @todo The above comment is incorrect: http://drupal.org/node/1547294.
- */
-function request_uri($omit_query_string = FALSE) {
-  if (isset($_SERVER['REQUEST_URI'])) {
-    $uri = $_SERVER['REQUEST_URI'];
-  }
-  else {
-    if (isset($_SERVER['argv'][0])) {
-      $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['argv'][0];
-    }
-    elseif (isset($_SERVER['QUERY_STRING'])) {
-      $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
-    }
-    else {
-      $uri = $_SERVER['SCRIPT_NAME'];
-    }
-  }
-  // Prevent multiple slashes to avoid cross site requests via the Form API.
-  $uri = '/' . ltrim($uri, '/');
-
-  return $omit_query_string ? strtok($uri, '?') : $uri;
-}
-
-/**
  * Logs an exception.
  *
  * This is a wrapper logging function which automatically decodes an exception.
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 923b747..df936c9 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -868,10 +868,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
-        // non-clean URLs unless
+        // $request->getPathInfo() 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->getPathInfo() . '/', $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..5d5452a 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -301,9 +301,9 @@ 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
-    // rebuilds, the form is submitted to an alternate URL, and the original
-    // #action needs to be retained.
+    // #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'])) {
       $form['#action'] = $old_form['#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->getMasterRequest()->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 d6a59ad..4d788c6 100644
--- a/core/modules/dblog/src/Tests/DbLogTest.php
+++ b/core/modules/dblog/src/Tests/DbLogTest.php
@@ -147,7 +147,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,
@@ -456,7 +456,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/locale.services.yml b/core/modules/locale/locale.services.yml
index 27cef2c..3df6f93 100644
--- a/core/modules/locale/locale.services.yml
+++ b/core/modules/locale/locale.services.yml
@@ -12,7 +12,7 @@ services:
     arguments: ['@keyvalue']
   string_translator.locale.lookup:
     class: Drupal\locale\LocaleTranslation
-    arguments: ['@locale.storage', '@cache.default', '@lock', '@config.factory', '@language_manager']
+    arguments: ['@locale.storage', '@cache.default', '@lock', '@config.factory', '@language_manager', '@request_stack']
     tags:
       - { name: string_translator }
       - { name: needs_destruction }
diff --git a/core/modules/locale/src/LocaleLookup.php b/core/modules/locale/src/LocaleLookup.php
index 8aa1809..f5b4fc1 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\RequestStack;
 
 /**
  * A cache collector to allow for dynamic building of the locale cache.
@@ -68,6 +69,13 @@ class LocaleLookup extends CacheCollector {
   protected $languageManager;
 
   /**
+   * The request stack.
+   *
+   * @var \Symfony\Component\HttpFoundation\RequestStack
+   */
+  protected $requestStack;
+
+  /**
    * Constructs a LocaleLookup object.
    *
    * @param string $langcode
@@ -84,8 +92,10 @@ class LocaleLookup extends CacheCollector {
    *   The config factory.
    * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
    *   The language manager.
+   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
+   *   The request stack.
    */
-  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, RequestStack $request_stack) {
     $this->langcode = $langcode;
     $this->context = (string) $context;
     $this->stringStorage = $string_storage;
@@ -95,6 +105,7 @@ public function __construct($langcode, $context, StringStorageInterface $string_
     $this->cache = $cache;
     $this->lock = $lock;
     $this->tags = array('locale');
+    $this->requestStack = $request_stack;
   }
 
   /**
@@ -142,7 +153,7 @@ protected function resolveCacheMiss($offset) {
         'source' => $offset,
         'context' => $this->context,
         'version' => \Drupal::VERSION,
-      ))->addLocation('path', $this->requestUri())->save();
+      ))->addLocation('path', $this->requestStack->getCurrentRequest()->getRequestUri())->save();
       $value = TRUE;
     }
 
@@ -177,11 +188,4 @@ protected function resolveCacheMiss($offset) {
     return $value;
   }
 
-  /**
-   * Wraps request_uri().
-   */
-  protected function requestUri($omit_query_string = FALSE) {
-    return request_uri($omit_query_string);
-  }
-
 }
diff --git a/core/modules/locale/src/LocaleTranslation.php b/core/modules/locale/src/LocaleTranslation.php
index 717f2fa..237a1ae 100644
--- a/core/modules/locale/src/LocaleTranslation.php
+++ b/core/modules/locale/src/LocaleTranslation.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Lock\LockBackendInterface;
 use Drupal\Core\StringTranslation\Translator\TranslatorInterface;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * String translator using the locale module.
@@ -75,6 +76,13 @@ class LocaleTranslation implements TranslatorInterface, DestructableInterface {
   protected $languageManager;
 
   /**
+   * The request stack.
+   *
+   * @var \Symfony\Component\HttpFoundation\RequestStack
+   */
+  protected $requestStack;
+
+  /**
    * Constructs a translator using a string storage.
    *
    * @param \Drupal\locale\StringStorageInterface $storage
@@ -87,13 +95,16 @@ class LocaleTranslation implements TranslatorInterface, DestructableInterface {
    *   The config factory.
    * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
    *   The language manager.
+   * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
+   *   The request stack.
    */
-  public function __construct(StringStorageInterface $storage, CacheBackendInterface $cache, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager) {
+  public function __construct(StringStorageInterface $storage, CacheBackendInterface $cache, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager, RequestStack $request_stack) {
     $this->storage = $storage;
     $this->cache = $cache;
     $this->lock = $lock;
     $this->configFactory = $config_factory;
     $this->languageManager = $language_manager;
+    $this->requestStack = $request_stack;
   }
 
   /**
@@ -107,7 +118,7 @@ public function getStringTranslation($langcode, $string, $context) {
     // Strings are cached by langcode, context and roles, using instances of the
     // LocaleLookup class to handle string lookup and caching.
     if (!isset($this->translations[$langcode][$context])) {
-      $this->translations[$langcode][$context] = new LocaleLookup($langcode, $context, $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager);
+      $this->translations[$langcode][$context] = new LocaleLookup($langcode, $context, $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack);
     }
     $translation = $this->translations[$langcode][$context]->get($string);
     return $translation === TRUE ? FALSE : $translation;
diff --git a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
index 8519291..fafcb45 100644
--- a/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
+++ b/core/modules/locale/tests/src/Unit/LocaleLookupTest.php
@@ -10,6 +10,8 @@
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\locale\LocaleLookup;
 use Drupal\Tests\UnitTestCase;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * @coversDefaultClass \Drupal\locale\LocaleLookup
@@ -60,6 +62,13 @@ class LocaleLookupTest extends UnitTestCase {
   protected $languageManager;
 
   /**
+   * The request stack.
+   *
+   * @var \Symfony\Component\HttpFoundation\RequestStack
+   */
+  protected $requestStack;
+
+  /**
    * {@inheritdoc}
    */
   protected function setUp() {
@@ -77,6 +86,7 @@ protected function setUp() {
     $this->configFactory = $this->getConfigFactoryStub(array('locale.settings' => array('cache_strings' => FALSE)));
 
     $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->requestStack = new RequestStack();
 
     $container = new ContainerBuilder();
     $container->set('current_user', $this->user);
@@ -109,8 +119,8 @@ public function testResolveCacheMissWithoutFallback() {
       ->will($this->returnValue($result));
 
     $locale_lookup = $this->getMockBuilder('Drupal\locale\LocaleLookup')
-      ->setConstructorArgs(array('en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager))
-      ->setMethods(array('persist', 'requestUri'))
+      ->setConstructorArgs(array('en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack))
+      ->setMethods(array('persist'))
       ->getMock();
     $locale_lookup->expects($this->never())
       ->method('persist');
@@ -175,7 +185,7 @@ public function testResolveCacheMissWithFallback($langcode, $string, $context, $
       ->method('get')
       ->with('locale:' . $langcode . ':' . $context . ':0', FALSE);
 
-    $locale_lookup = new LocaleLookup($langcode, $context, $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager);
+    $locale_lookup = new LocaleLookup($langcode, $context, $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack);
     $this->assertSame($expected, $locale_lookup->get($string));
   }
 
@@ -222,8 +232,8 @@ public function testResolveCacheMissWithPersist() {
 
     $this->configFactory = $this->getConfigFactoryStub(array('locale.settings' => array('cache_strings' => TRUE)));
     $locale_lookup = $this->getMockBuilder('Drupal\locale\LocaleLookup')
-      ->setConstructorArgs(array('en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager))
-      ->setMethods(array('persist', 'requestUri'))
+      ->setConstructorArgs(array('en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack))
+      ->setMethods(array('persist'))
       ->getMock();
     $locale_lookup->expects($this->once())
       ->method('persist');
@@ -248,9 +258,12 @@ public function testResolveCacheMissNoTranslation() {
       ->method('createString')
       ->will($this->returnValue($string));
 
+    $request = Request::create('/test');
+    $this->requestStack->push($request);
+
     $locale_lookup = $this->getMockBuilder('Drupal\locale\LocaleLookup')
-      ->setConstructorArgs(array('en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager))
-      ->setMethods(array('persist', 'requestUri'))
+      ->setConstructorArgs(array('en', 'irrelevant', $this->storage, $this->cache, $this->lock, $this->configFactory, $this->languageManager, $this->requestStack))
+      ->setMethods(array('persist'))
       ->getMock();
     $locale_lookup->expects($this->never())
       ->method('persist');
diff --git a/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php b/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
index 03c1536..0c9b49f 100644
--- a/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
+++ b/core/modules/locale/tests/src/Unit/LocaleTranslationTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\locale\LocaleTranslation;
 use Drupal\Tests\UnitTestCase;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * @coversDefaultClass \Drupal\locale\LocaleTranslation
@@ -31,6 +32,13 @@ class LocaleTranslationTest extends UnitTestCase {
   protected $languageManager;
 
   /**
+   * The request stack.
+   *
+   * @var \Symfony\Component\HttpFoundation\RequestStack
+   */
+  protected $requestStack;
+
+  /**
    * {@inheritdoc}
    */
   protected function setUp() {
@@ -38,13 +46,14 @@ protected function setUp() {
     $this->cache = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
     $this->lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
     $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->requestStack = new RequestStack();
   }
 
   /**
    * Tests for \Drupal\locale\LocaleTranslation::destruct().
    */
   public function testDestruct() {
-    $translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this->getConfigFactoryStub(), $this->languageManager);
+    $translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this->getConfigFactoryStub(), $this->languageManager, $this->requestStack);
     // Prove that destruction works without errors when translations are empty.
     $this->assertAttributeEmpty('translations', $translation);
     $translation->destruct();
