diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index d6e40d1..f518d7e 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1855,7 +1855,7 @@
       '%core' => $release['core'],
       '%language' => $langcode,
     );
-    $translation_urls[] = strtr($server_pattern, $variables);
+    $translation_urls[] = drupal_strtr($server_pattern, $variables);
   }
   $elements = parse_url(reset($translation_urls));
   $server_url = $elements['scheme'] . '://' . $elements['host'];
diff --git a/core/includes/install.inc b/core/includes/install.inc
index ec6283b..50f07b1 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -14,6 +14,8 @@
 use Drupal\Core\Extension\ExtensionDiscovery;
 use Drupal\Core\Site\Settings;
 
+require_once "utility.inc";
+
 /**
  * Requirement severity -- Informational message only.
  */
diff --git a/core/includes/utility.inc b/core/includes/utility.inc
index 802331c..dbc4c4f 100644
--- a/core/includes/utility.inc
+++ b/core/includes/utility.inc
@@ -48,9 +48,22 @@
   \Drupal::service('page_cache_kill_switch')->trigger();
 
   drupal_flush_all_caches();
+        
+        // Restore Drupal's error and exception handlers.
+        // @see \Drupal\Core\DrupalKernel::boot()
+    set_error_handler('_drupal_error_handler');
+    set_exception_handler('_drupal_exception_handler');
+}
 
-  // Restore Drupal's error and exception handlers.
-  // @see \Drupal\Core\DrupalKernel::boot()
-  set_error_handler('_drupal_error_handler');
-  set_exception_handler('_drupal_exception_handler');
+/**
+ * Optimization for PHP 5.4 where strtr() has memory issues when called with $replace_pairs.
+ *
+ * @see strtr
+ */
+function drupal_strtr($str, $replace_pairs) {
+  foreach ($replace_pairs as $target => $replacement) {
+    $str = str_replace($target, $replacement, $str);
+  }
+  
+  return $str;
 }
diff --git a/core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php b/core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php
index 94d969b..c11d99e 100644
--- a/core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php
+++ b/core/lib/Drupal/Component/Bridge/ZfExtensionManagerSfContainer.php
@@ -82,7 +82,7 @@
       return $this->canonicalNames[$name];
     }
     // This is just for performance instead of using str_replace().
-    return $this->canonicalNames[$name] = strtolower(strtr($name, $this->canonicalNamesReplacements));
+    return $this->canonicalNames[$name] = strtolower(drupal_strtr($name, $this->canonicalNamesReplacements));
   }
 
   /**
diff --git a/core/lib/Drupal/Component/Gettext/PoHeader.php b/core/lib/Drupal/Component/Gettext/PoHeader.php
index 3136f2e..575c348 100644
--- a/core/lib/Drupal/Component/Gettext/PoHeader.php
+++ b/core/lib/Drupal/Component/Gettext/PoHeader.php
@@ -198,7 +198,7 @@
   function parsePluralForms($pluralforms) {
     $plurals = array();
     // First, delete all whitespace.
-    $pluralforms = strtr($pluralforms, array(" " => "", "\t" => ""));
+    $pluralforms = drupal_strtr($pluralforms, array(" " => "", "\t" => ""));
 
     // Select the parts that define nplurals and plural.
     $nplurals = strstr($pluralforms, "nplurals=");
diff --git a/core/lib/Drupal/Component/Gettext/PoStreamReader.php b/core/lib/Drupal/Component/Gettext/PoStreamReader.php
index 94218e6..ffda1bf 100644
--- a/core/lib/Drupal/Component/Gettext/PoStreamReader.php
+++ b/core/lib/Drupal/Component/Gettext/PoStreamReader.php
@@ -276,7 +276,7 @@
 
       // Trim away the linefeed. \\n might appear at the end of the string if
       // another line continuing the same string follows. We can remove that.
-      $line = trim(strtr($line, array("\\\n" => "")));
+      $line = trim(drupal_strtr($line, array("\\\n" => "")));
 
       if (!strncmp('#', $line, 1)) {
         // Lines starting with '#' are comments.
diff --git a/core/lib/Drupal/Component/Utility/Crypt.php b/core/lib/Drupal/Component/Utility/Crypt.php
index ef5ebfe..11c11a4 100644
--- a/core/lib/Drupal/Component/Utility/Crypt.php
+++ b/core/lib/Drupal/Component/Utility/Crypt.php
@@ -106,7 +106,7 @@
 
     $hmac = base64_encode(hash_hmac('sha256', $data, $key, TRUE));
     // Modify the hmac so it's safe to use in URLs.
-    return strtr($hmac, array('+' => '-', '/' => '_', '=' => ''));
+    return drupal_strtr($hmac, array('+' => '-', '/' => '_', '=' => ''));
   }
 
   /**
@@ -122,7 +122,7 @@
   public static function hashBase64($data) {
     $hash = base64_encode(hash('sha256', $data, TRUE));
     // Modify the hash so it's safe to use in URLs.
-    return strtr($hash, array('+' => '-', '/' => '_', '=' => ''));
+    return drupal_strtr($hash, array('+' => '-', '/' => '_', '=' => ''));
   }
 
   /**
@@ -137,7 +137,7 @@
    * @see \Drupal\Component\Utility\Crypt::randomBytes()
    */
   public static function randomBytesBase64($count = 32) {
-    return strtr(base64_encode(static::randomBytes($count)), array('+' => '-', '/' => '_', '=' => ''));
+    return drupal_strtr(base64_encode(static::randomBytes($count)), array('+' => '-', '/' => '_', '=' => ''));
   }
 
 }
diff --git a/core/lib/Drupal/Component/Utility/Html.php b/core/lib/Drupal/Component/Utility/Html.php
index 4dd9d27..ad358a8 100644
--- a/core/lib/Drupal/Component/Utility/Html.php
+++ b/core/lib/Drupal/Component/Utility/Html.php
@@ -83,7 +83,7 @@
     '[' => '-',
     ']' => ''
   )) {
-    $identifier = strtr($identifier, $filter);
+    $identifier = drupal_strtr($identifier, $filter);
     // Valid characters in a CSS identifier are:
     // - the hyphen (U+002D)
     // - a-z (U+0030 - U+0039)
@@ -215,7 +215,7 @@
    * @see self::getUniqueId()
    */
   public static function getId($id) {
-    $id = strtr(Unicode::strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
+    $id = drupal_strtr(Unicode::strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
 
     // As defined in http://www.w3.org/TR/html4/types.html#type-name, HTML IDs can
     // only contain letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
@@ -281,7 +281,7 @@
     // PHP's \DOMDocument serialization adds straw whitespace in case the markup
     // of the wrapping document contains newlines, so ensure to remove all
     // newlines before injecting the actual HTML body to process.
-    $document = strtr($document, array("\n" => '', '!html' => $html));
+    $document = drupal_strtr($document, array("\n" => '', '!html' => $html));
 
     $dom = new \DOMDocument();
     // Ignore warnings during HTML soup loading.
diff --git a/core/lib/Drupal/Component/Utility/String.php b/core/lib/Drupal/Component/Utility/String.php
index 970436c..1ca6757 100644
--- a/core/lib/Drupal/Component/Utility/String.php
+++ b/core/lib/Drupal/Component/Utility/String.php
@@ -114,7 +114,7 @@
           // Pass-through.
       }
     }
-    return SafeMarkup::set(strtr($string, $args));
+    return SafeMarkup::set(drupal_strtr($string, $args));
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php
index d775cc2..7aaf2cf 100644
--- a/core/lib/Drupal/Core/Config/TypedConfigManager.php
+++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php
@@ -221,7 +221,7 @@
       foreach (array_combine($matches[0], $matches[1]) as $key => $value) {
         $replace[$key] = $this->replaceVariable($value, $data);
       }
-      return strtr($name, $replace);
+      return drupal_strtr($name, $replace);
     }
     else {
       return $name;
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
index 2190ee5..a7972bd 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
@@ -742,7 +742,7 @@
   protected function hashBase64($data) {
     $hash = base64_encode(hash('sha256', $data, TRUE));
     // Modify the hash so it's safe to use in PostgreSQL identifiers.
-    return strtr($hash, array('+' => '_', '/' => '_', '=' => ''));
+    return drupal_strtr($hash, array('+' => '_', '/' => '_', '=' => ''));
   }
 }
 
diff --git a/core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php
index c5d18db..22600d5 100644
--- a/core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/Fast404ExceptionHtmlSubscriber.php
@@ -79,7 +79,7 @@
     if ($config->get('fast_404.enabled') && $exclude_paths && !preg_match($exclude_paths, $request->getPathInfo())) {
       $fast_paths = $config->get('fast_404.paths');
       if ($fast_paths && preg_match($fast_paths, $request->getPathInfo())) {
-        $fast_404_html = strtr($config->get('fast_404.html'), ['@path' => String::checkPlain($request->getUri())]);
+        $fast_404_html = drupal_strtr($config->get('fast_404.html'), ['@path' => String::checkPlain($request->getUri())]);
         $response = new Response($fast_404_html, Response::HTTP_NOT_FOUND);
         $event->setResponse($response);
       }
diff --git a/core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php b/core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php
index ebde906..1f06a5a 100644
--- a/core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php
+++ b/core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php
@@ -157,7 +157,7 @@
    *   The menu plugin ID with double underscore instead of dots.
    */
   protected static function encodeId($id) {
-    return strtr($id, array('.' => '__', '__' => '___'));
+    return drupal_strtr($id, array('.' => '__', '__' => '___'));
   }
 
 }
diff --git a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
index 684e4b7..6d37d16 100644
--- a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
+++ b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php
@@ -99,7 +99,7 @@
       if (!empty($title) && !empty($path)) {
         // Make sure that tokens are replaced for this paths as well.
         $tokens = $this->getRenderTokens(array());
-        $path = strip_tags(String::decodeEntities(strtr($path, $tokens)));
+        $path = strip_tags(String::decodeEntities(drupal_strtr($path, $tokens)));
 
         $links[$field] = array(
           'href' => $path,
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 1d78fb3..c8fa435 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -1236,7 +1236,7 @@
   $classes = array(
     'file',
     // Add a specific class for each and every mime type.
-    'file--mime-' . strtr($mime_type, array('/' => '-', '.' => '-')),
+    'file--mime-' . drupal_strtr($mime_type, array('/' => '-', '.' => '-')),
     // Add a more general class for groups of well known mime types.
     'file--' . file_icon_class($mime_type),
   );
diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc
index 5453f7c..dc526ef 100644
--- a/core/modules/locale/locale.translation.inc
+++ b/core/modules/locale/locale.translation.inc
@@ -316,7 +316,7 @@
     '%core' => $project->core,
     '%language' => isset($project->langcode) ? $project->langcode : '%language',
   );
-  return strtr($template, $variables);
+  return drupal_strtr($template, $variables);
 }
 
 /**
diff --git a/core/modules/node/src/Tests/NodeAccessBaseTableTest.php b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php
index d5e4dd4..dc9b3dd 100644
--- a/core/modules/node/src/Tests/NodeAccessBaseTableTest.php
+++ b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php
@@ -106,7 +106,7 @@
           else {
             $should_be_visible = TRUE;
           }
-          $this->assertResponse($should_be_visible ? 200 : 403, strtr('A %private node by user %uid is %visible for user %current_uid.', array(
+          $this->assertResponse($should_be_visible ? 200 : 403, drupal_strtr('A %private node by user %uid is %visible for user %current_uid.', array(
             '%private' => $is_private ? 'private' : 'public',
             '%uid' => $uid,
             '%visible' => $should_be_visible ? 'visible' : 'not visible',
@@ -163,7 +163,7 @@
           if (!$is_admin && $tid_is_private) {
             $should_be_visible = $should_be_visible && $uid == $this->webUser->id();
           }
-          $this->assertIdentical(isset($this->nids_visible[$nid]), $should_be_visible, strtr('A %private node by user %uid is %visible for user %current_uid on the %tid_is_private page.', array(
+          $this->assertIdentical(isset($this->nids_visible[$nid]), $should_be_visible, drupal_strtr('A %private node by user %uid is %visible for user %current_uid on the %tid_is_private page.', array(
             '%private' => $is_private ? 'private' : 'public',
             '%uid' => $uid,
             '%visible' => isset($this->nids_visible[$nid]) ? 'visible' : 'not visible',
diff --git a/core/modules/syslog/src/Logger/SysLog.php b/core/modules/syslog/src/Logger/SysLog.php
index bf3df85..20f6c37 100644
--- a/core/modules/syslog/src/Logger/SysLog.php
+++ b/core/modules/syslog/src/Logger/SysLog.php
@@ -76,9 +76,9 @@
 
     // Populate the message placeholders and then replace them in the message.
     $message_placeholders = $this->parser->parseMessagePlaceholders($message, $context);
-    $message = empty($message_placeholders) ? $message : strtr($message, $message_placeholders);
+    $message = empty($message_placeholders) ? $message : drupal_strtr($message, $message_placeholders);
 
-    $entry = strtr($this->config->get('format'), array(
+    $entry = drupal_strtr($this->config->get('format'), array(
       '!base_url' => $base_url,
       '!timestamp' => $context['timestamp'],
       '!type' => $context['channel'],
diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php
index 25568b0..6c44529 100644
--- a/core/modules/system/src/Form/ThemeSettingsForm.php
+++ b/core/modules/system/src/Form/ThemeSettingsForm.php
@@ -240,7 +240,7 @@
 
         // Prepare local file path for description.
         if ($original_path && isset($friendly_path)) {
-          $local_file = strtr($original_path, array('public:/' => PublicStream::basePath()));
+          $local_file = drupal_strtr($original_path, array('public:/' => PublicStream::basePath()));
         }
         elseif ($theme) {
           $local_file = drupal_get_path('theme', $theme) . '/' . $default;
diff --git a/core/modules/system/src/Tests/Common/TableSortExtenderUnitTest.php b/core/modules/system/src/Tests/Common/TableSortExtenderUnitTest.php
index aa39b75..92a2048 100644
--- a/core/modules/system/src/Tests/Common/TableSortExtenderUnitTest.php
+++ b/core/modules/system/src/Tests/Common/TableSortExtenderUnitTest.php
@@ -38,7 +38,7 @@
     $request->query->replace(array());
     \Drupal::getContainer()->get('request_stack')->push($request);
     $ts = tablesort_init($headers);
-    $this->verbose(strtr('$ts: <pre>!ts</pre>', array('!ts' => String::checkPlain(var_export($ts, TRUE)))));
+    $this->verbose(drupal_strtr('$ts: <pre>!ts</pre>', array('!ts' => String::checkPlain(var_export($ts, TRUE)))));
     $this->assertEqual($ts, $expected_ts, 'Simple table headers sorted correctly.');
 
     // Test with simple table headers plus $_GET parameters that should _not_
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
index 1df6c88..1fef5c1 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
@@ -569,7 +569,7 @@
       $found = FALSE;
       break;
     }
-    return $this->assertTrue($found, strtr('!expected expected, !found found', array('!expected' => print_r($expected, TRUE), '!found' => print_r($this->queryResult, TRUE))));
+    return $this->assertTrue($found, drupal_strtr('!expected expected, !found found', array('!expected' => print_r($expected, TRUE), '!found' => print_r($this->queryResult, TRUE))));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Form/FormTest.php b/core/modules/system/src/Tests/Form/FormTest.php
index a377e6e..b0cc1fc 100644
--- a/core/modules/system/src/Tests/Form/FormTest.php
+++ b/core/modules/system/src/Tests/Form/FormTest.php
@@ -612,7 +612,7 @@
       if (isset($type_map[$item['#type']])) {
         $type = $type_map[$item['#type']];
       }
-      $path = strtr($path, array('!type' => $type));
+      $path = drupal_strtr($path, array('!type' => $type));
       // Verify that the element exists.
       $element = $this->xpath($path, array(
         ':name' => String::checkPlain($name),
diff --git a/core/modules/system/src/Tests/Menu/MenuTestBase.php b/core/modules/system/src/Tests/Menu/MenuTestBase.php
index 2478af3..8ffb00d 100644
--- a/core/modules/system/src/Tests/Menu/MenuTestBase.php
+++ b/core/modules/system/src/Tests/Menu/MenuTestBase.php
@@ -40,7 +40,7 @@
 
     // Additionally assert page title, if given.
     if (isset($page_title)) {
-      $this->assertTitle(strtr('@title | Drupal', array('@title' => $page_title)));
+      $this->assertTitle(drupal_strtr('@title | Drupal', array('@title' => $page_title)));
     }
 
     // Additionally assert active trail in a menu tree output, if given.
diff --git a/core/modules/system/src/Tests/System/SystemAuthorizeTest.php b/core/modules/system/src/Tests/System/SystemAuthorizeTest.php
index 2fd4d6e..2d6b3e0 100644
--- a/core/modules/system/src/Tests/System/SystemAuthorizeTest.php
+++ b/core/modules/system/src/Tests/System/SystemAuthorizeTest.php
@@ -52,7 +52,7 @@
   function testFileTransferHooks() {
     $page_title = $this->randomMachineName(16);
     $this->drupalGetAuthorizePHP($page_title);
-    $this->assertTitle(strtr('@title | Drupal', array('@title' => $page_title)), 'authorize.php page title is correct.');
+    $this->assertTitle(drupal_strtr('@title | Drupal', array('@title' => $page_title)), 'authorize.php page title is correct.');
     $this->assertNoText('It appears you have reached this page in error.');
     $this->assertText('To continue, provide your server connection details');
     // Make sure we see the new connection method added by system_test.
diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php
index 1534675..92919de 100644
--- a/core/modules/system/src/Tests/System/ThemeTest.php
+++ b/core/modules/system/src/Tests/System/ThemeTest.php
@@ -47,7 +47,7 @@
 
     // Specify a filesystem path to be used for the logo.
     $file = current($this->drupalGetTestFiles('image'));
-    $file_relative = strtr($file->uri, array('public:/' => PublicStream::basePath()));
+    $file_relative = drupal_strtr($file->uri, array('public:/' => PublicStream::basePath()));
     $default_theme_path = 'core/themes/stark';
 
     $supported_paths = array(
@@ -99,7 +99,7 @@
       if (file_uri_scheme($input) == 'public') {
         $implicit_public_file = file_uri_target($input);
         $explicit_file = $input;
-        $local_file = strtr($input, array('public:/' => PublicStream::basePath()));
+        $local_file = drupal_strtr($input, array('public:/' => PublicStream::basePath()));
       }
       // Adjust for fully qualified stream wrapper URI elsewhere.
       elseif (file_uri_scheme($input) !== FALSE) {
diff --git a/core/modules/system/src/Tests/System/ThemeTest.php.rej b/core/modules/system/src/Tests/System/ThemeTest.php.rej
new file mode 100644
index 0000000..bfaa267
--- /dev/null
+++ b/core/modules/system/src/Tests/System/ThemeTest.php.rej
@@ -0,0 +1,9 @@
+@@ -46,7 +46,7 @@
+ 
+     // Specify a filesystem path to be used for the logo.
+     $file = current($this->drupalGetTestFiles('image'));
+-    $file_relative = strtr($file->uri, array('public:/' => PublicStream::basePath()));
++    $file_relative = strtr($file->uri, 'public:/', PublicStream::basePath());
+     $default_theme_path = 'core/themes/stark';
+ 
+     $supported_paths = array(
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 4e98a64..79ab500 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -481,7 +481,7 @@
     );
   }
   $subject = strtr($context['subject'], $variables);
-  $body = strtr($context['message'], $variables);
+  $body = drupal_strtr($context['message'], $variables);
   $message['subject'] .= str_replace(array("\r", "\n"), '', $subject);
   $message['body'][] = MailFormatHelper::htmlToText($body);
 }
diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
index 04b3b78..1fdb462 100644
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -2098,7 +2098,7 @@
 
       if ($this->getOption('link_display') == 'custom_url' && $override_path = $this->getOption('link_url')) {
         $tokens = $this->getArgumentsTokens();
-        $path = strtr($override_path, $tokens);
+        $path = drupal_strtr($override_path, $tokens);
       }
 
       if ($path) {
diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
index f13b8db..d01bae8 100644
--- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -1281,9 +1281,9 @@
       if ($this->options['alter']['more_link'] && strlen($value) < $length) {
         $tokens = $this->getRenderTokens($alter);
         $more_link_text = $this->options['alter']['more_link_text'] ? $this->options['alter']['more_link_text'] : $this->t('more');
-        $more_link_text = strtr(Xss::filterAdmin($more_link_text), $tokens);
+        $more_link_text = drupal_strtr(Xss::filterAdmin($more_link_text), $tokens);
         $more_link_path = $this->options['alter']['more_link_path'];
-        $more_link_path = strip_tags(String::decodeEntities(strtr($more_link_path, $tokens)));
+        $more_link_path = strip_tags(String::decodeEntities(drupal_strtr($more_link_path, $tokens)));
 
         // Make sure that paths which were run through _url() work as well.
         $base_path = base_path();
@@ -1319,7 +1319,7 @@
   protected function renderAltered($alter, $tokens) {
     // Filter this right away as our substitutions are already sanitized.
     $value = Xss::filterAdmin($alter['text']);
-    $value = strtr($value, $tokens);
+    $value = drupal_strtr($value, $tokens);
 
     return $value;
   }
@@ -1344,7 +1344,7 @@
     $value = '';
 
     if (!empty($alter['prefix'])) {
-      $value .= Xss::filterAdmin(strtr($alter['prefix'], $tokens));
+      $value .= Xss::filterAdmin(drupal_strtr($alter['prefix'], $tokens));
     }
 
     $options = array(
@@ -1365,7 +1365,7 @@
       // Use strip tags as there should never be HTML in the path.
       // However, we need to preserve special characters like " that
       // were removed by String::checkPlain().
-      $path = strip_tags(String::decodeEntities(strtr($path, $tokens)));
+      $path = strip_tags(String::decodeEntities(drupal_strtr($path, $tokens)));
 
       if (!empty($alter['path_case']) && $alter['path_case'] != 'none') {
         $path = $this->caseTransform($path, $this->options['alter']['path_case']);
@@ -1426,7 +1426,7 @@
     }
 
     if (isset($url['fragment'])) {
-      $path = strtr($path, array('#' . $url['fragment'] => ''));
+      $path = drupal_strtr($path, array('#' . $url['fragment'] => ''));
       // If the path is empty we want to have a fragment for the current site.
       if ($path == '') {
         $options['external'] = TRUE;
@@ -1434,22 +1434,22 @@
       $options['fragment'] = $url['fragment'];
     }
 
-    $alt = strtr($alter['alt'], $tokens);
+    $alt = drupal_strtr($alter['alt'], $tokens);
     // Set the title attribute of the link only if it improves accessibility
     if ($alt && $alt != $text) {
       $options['attributes']['title'] = String::decodeEntities($alt);
     }
 
-    $class = strtr($alter['link_class'], $tokens);
+    $class = drupal_strtr($alter['link_class'], $tokens);
     if ($class) {
       $options['attributes']['class'] = array($class);
     }
 
-    if (!empty($alter['rel']) && $rel = strtr($alter['rel'], $tokens)) {
+    if (!empty($alter['rel']) && $rel = drupal_strtr($alter['rel'], $tokens)) {
       $options['attributes']['rel'] = $rel;
     }
 
-    $target = String::checkPlain(trim(strtr($alter['target'], $tokens)));
+    $target = String::checkPlain(trim(drupal_strtr($alter['target'], $tokens)));
     if (!empty($target)) {
       $options['attributes']['target'] = $target;
     }
@@ -1459,7 +1459,7 @@
     if (isset($alter['link_attributes']) && is_array($alter['link_attributes'])) {
       foreach ($alter['link_attributes'] as $key => $attribute) {
         if (!isset($options['attributes'][$key])) {
-          $options['attributes'][$key] = strtr($attribute, $tokens);
+          $options['attributes'][$key] = drupal_strtr($attribute, $tokens);
         }
       }
     }
@@ -1470,7 +1470,7 @@
       // Convert the query to a string, perform token replacement, and then
       // convert back to an array form for _l().
       $options['query'] = UrlHelper::buildQuery($alter['query']);
-      $options['query'] = strtr($options['query'], $tokens);
+      $options['query'] = drupal_strtr($options['query'], $tokens);
       $query = array();
       parse_str($options['query'], $query);
       $options['query'] = $query;
@@ -1480,7 +1480,7 @@
       $options['alias'] = $alter['alias'];
     }
     if (isset($alter['fragment'])) {
-      $options['fragment'] = strtr($alter['fragment'], $tokens);
+      $options['fragment'] = drupal_strtr($alter['fragment'], $tokens);
     }
     if (isset($alter['language'])) {
       $options['language'] = $alter['language'];
@@ -1502,7 +1502,7 @@
     }
 
     if (!empty($alter['suffix'])) {
-      $value .= Xss::filterAdmin(strtr($alter['suffix'], $tokens));
+      $value .= Xss::filterAdmin(drupal_strtr($alter['suffix'], $tokens));
     }
 
     return $value;
diff --git a/core/modules/views/src/Plugin/views/field/Links.php b/core/modules/views/src/Plugin/views/field/Links.php
index b8f4098..63e4ade 100644
--- a/core/modules/views/src/Plugin/views/field/Links.php
+++ b/core/modules/views/src/Plugin/views/field/Links.php
@@ -82,7 +82,7 @@
       }
       // Make sure that tokens are replaced for this paths as well.
       $tokens = $this->getRenderTokens(array());
-      $path = strip_tags(String::decodeEntities(strtr($path, $tokens)));
+      $path = strip_tags(String::decodeEntities(drupal_strtr($path, $tokens)));
 
       $links[$field] = array(
         'url' => $path ? UrlObject::fromUri('base://' . $path) : $url,
diff --git a/core/modules/views/src/Plugin/views/query/Sql.php b/core/modules/views/src/Plugin/views/query/Sql.php
index 48856cf..e893325 100644
--- a/core/modules/views/src/Plugin/views/query/Sql.php
+++ b/core/modules/views/src/Plugin/views/query/Sql.php
@@ -1696,7 +1696,7 @@
           's' => '%s',
           'A' => '%p',
         );
-        $format = strtr($format, $replace);
+        $format = drupal_strtr($format, $replace);
         return "DATE_FORMAT($field, '$format')";
       case 'pgsql':
         $replace = array(
diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
index b97eea2..ff4dd33 100644
--- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php
+++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php
@@ -235,7 +235,7 @@
       }
 
       if ($tokens) {
-        $value = strtr($value, $tokens);
+        $value = drupal_strtr($value, $tokens);
       }
     }
 
diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php
index 75c309c..ca5e08b 100644
--- a/core/modules/views_ui/src/ViewUI.php
+++ b/core/modules/views_ui/src/ViewUI.php
@@ -670,7 +670,7 @@
             }
             $rows['query'][] = array(
               array('data' => array('#type' => 'inline_template', '#template' => "<strong>{% trans 'Query' %}</strong>")),
-              array('data' => array('#type' => 'inline_template', '#template' => '<pre>{{ query }}</pre>', '#context' => array('query' => strtr($query_string, $quoted)))),
+              array('data' => array('#type' => 'inline_template', '#template' => '<pre>{{ query }}</pre>', '#context' => array('query' => drupal_strtr($query_string, $quoted)))),
             );
             if (!empty($this->additionalQueries)) {
               $queries = '<strong>' . t('These queries were run during view rendering:') . '</strong>';
@@ -678,7 +678,7 @@
                 if ($queries) {
                   $queries .= "\n";
                 }
-                $query_string = strtr($query['query'], $query['args']);
+                $query_string = drupal_strtr($query['query'], $query['args']);
                 $queries .= t('[@time ms] @query', array('@time' => round($query['time'] * 100000, 1) / 100000.0, '@query' => $query_string));
               }
 
diff --git a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php
index 4c5a239..13b4911 100644
--- a/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php
+++ b/core/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php
@@ -277,7 +277,7 @@
             }
         }
 
-        $proxyCode = strtr($this->proxyClassTemplate, $placeholders);
+        $proxyCode = drupal_strtr($this->proxyClassTemplate, $placeholders);
 
         if ( ! $fileName) {
             $proxyClassName = $this->generateNamespace($class) . '\\' . $this->generateProxyShortClassName($class);
diff --git a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php
index 3308d9f..ddeed12 100644
--- a/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php
+++ b/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Container.php
@@ -213,7 +213,7 @@
 
         $this->services[$id] = $service;
 
-        if (method_exists($this, $method = 'synchronize'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) {
+        if (method_exists($this, $method = 'synchronize'.drupal_strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) {
             $this->$method();
         }
 
@@ -246,7 +246,7 @@
         return isset($this->services[$id])
             || array_key_exists($id, $this->services)
             || isset($this->aliases[$id])
-            || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')
+            || method_exists($this, 'get'.drupal_strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')
         ;
     }
 
@@ -298,7 +298,7 @@
 
         if (isset($this->methodMap[$id])) {
             $method = $this->methodMap[$id];
-        } elseif (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) {
+        } elseif (method_exists($this, $method = 'get'.drupal_strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) {
             // $method is set to the right value, proceed
         } else {
             if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
@@ -546,7 +546,7 @@
      */
     public static function camelize($id)
     {
-        return strtr(ucwords(strtr($id, array('_' => ' ', '.' => '_ ', '\\' => '_ '))), array(' ' => ''));
+        return drupal_strtr(ucwords(drupal_strtr($id, array('_' => ' ', '.' => '_ ', '\\' => '_ '))), array(' ' => ''));
     }
 
     /**
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php
index ccb9d96..8696064 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Generator/UrlGenerator.php
@@ -194,7 +194,7 @@
         // the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3
         // so we need to encode them as they are not used for this purpose here
         // otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route
-        $url = strtr($url, array('/../' => '/%2E%2E/', '/./' => '/%2E/'));
+        $url = drupal_strtr($url, array('/../' => '/%2E%2E/', '/./' => '/%2E/'));
         if ('/..' === substr($url, -3)) {
             $url = substr($url, 0, -2).'%2E%2E';
         } elseif ('/.' === substr($url, -2)) {
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
index fc76c19..6947528 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
@@ -140,7 +140,7 @@
             $variables[] = 'E=_ROUTING_param_'.$variable.':%'.($i + 1);
         }
         foreach ($this->normalizeValues($route->getDefaults()) as $key => $value) {
-            $variables[] = 'E=_ROUTING_default_'.$key.':'.strtr($value, array(
+            $variables[] = 'E=_ROUTING_default_'.$key.':'.drupal_strtr($value, array(
                 ':'  => '\\:',
                 '='  => '\\=',
                 '\\' => '\\\\',
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php.rej b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php.rej
new file mode 100644
index 0000000..c5dbec0
--- /dev/null
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php.rej
@@ -0,0 +1,9 @@
+@@ -139,7 +139,7 @@
+             $variables[] = 'E=_ROUTING_param_'.$variable.':%'.($i + 1);
+         }
+         foreach ($this->normalizeValues($route->getDefaults()) as $key => $value) {
+-            $variables[] = 'E=_ROUTING_default_'.$key.':'.strtr($value, array(
++            $variables[] = 'E=_ROUTING_default_'.$key.':'.drupal_strtr($value, array(
+                 ':'  => '\\:',
+                 '='  => '\\=',
+                 '\\' => '\\\\',
diff --git a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
index 8f5f332..5ed56ab 100644
--- a/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
+++ b/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
@@ -169,7 +169,7 @@
 
         $matcher = new UrlMatcher($collection, new RequestContext());
         $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/'.rawurlencode($chars).'/bar'));
-        $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/'.strtr($chars, array('%' => '%25')).'/bar'));
+        $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/' . drupal_strtr($chars, array('%' => '%25')) . '/bar'));
     }
 
     public function testMatchWithDotMetacharacterInRequirements()
diff --git a/core/vendor/symfony/validator/Symfony/Component/Validator/DefaultTranslator.php b/core/vendor/symfony/validator/Symfony/Component/Validator/DefaultTranslator.php
index 3c1171f..0e24aa9 100644
--- a/core/vendor/symfony/validator/Symfony/Component/Validator/DefaultTranslator.php
+++ b/core/vendor/symfony/validator/Symfony/Component/Validator/DefaultTranslator.php
@@ -73,7 +73,7 @@
      */
     public function trans($id, array $parameters = array(), $domain = null, $locale = null)
     {
-        return strtr($id, $parameters);
+        return drupal_strtr($id, $parameters);
     }
 
     /**
@@ -133,7 +133,7 @@
         $ids = explode('|', $id);
 
         if (1 == $number) {
-            return strtr($ids[0], $parameters);
+            return drupal_strtr($ids[0], $parameters);
         }
 
         if (!isset($ids[1])) {
