Commit f98cf1f6 authored by alexpott's avatar alexpott

Issue #2361809 by rpayanm, nlisgo: Remove usage of drupal_strtoupper().

parent ea325a90
......@@ -199,7 +199,7 @@ protected function processField($field) {
// Set the correct database-engine specific datatype.
// In case one is already provided, force it to uppercase.
if (isset($field['mysql_type'])) {
$field['mysql_type'] = drupal_strtoupper($field['mysql_type']);
$field['mysql_type'] = Unicode::strtoupper($field['mysql_type']);
}
else {
$map = $this->getFieldTypeMap();
......
......@@ -125,7 +125,7 @@ protected function processField($field) {
// Set the correct database-engine specific datatype.
// In case one is already provided, force it to uppercase.
if (isset($field['sqlite_type'])) {
$field['sqlite_type'] = drupal_strtoupper($field['sqlite_type']);
$field['sqlite_type'] = Unicode::strtoupper($field['sqlite_type']);
}
else {
$map = $this->getFieldTypeMap();
......
......@@ -311,7 +311,7 @@ protected function mapConditionOperator($operator) {
}
else {
// We need to upper case because PHP index matches are case sensitive but
// do not need the more expensive drupal_strtoupper because SQL statements are ASCII.
// do not need the more expensive Unicode::strtoupper() because SQL statements are ASCII.
$operator = strtoupper($operator);
$return = isset($specials[$operator]) ? $specials[$operator] : array();
}
......
......@@ -226,12 +226,12 @@ public static function htmlToText($string, $allowed_tags = NULL) {
// Fancy headers.
case 'h1':
$indent[] = '======== ';
$casing = 'drupal_strtoupper';
$casing = '\Drupal\Component\Utility\Unicode::strtoupper';
break;
case 'h2':
$indent[] = '-------- ';
$casing = 'drupal_strtoupper';
$casing = '\Drupal\Component\Utility\Unicode::strtoupper';
break;
case '/h1':
......@@ -273,7 +273,7 @@ public static function htmlToText($string, $allowed_tags = NULL) {
if (isset($chunk)) {
// Apply any necessary case conversion.
if (isset($casing)) {
$chunk = $casing($chunk);
$chunk = call_user_func($casing, $chunk);
}
$line_endings = Settings::get('mail_line_endings', PHP_EOL);
// Format it and apply the current indentation.
......
......@@ -8,6 +8,7 @@
namespace Drupal\system\Tests\Mail;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Site\Settings;
use Drupal\simpletest\WebTestBase;
......@@ -242,8 +243,8 @@ public function testDrupalHtmlToTextBlockTagToNewline() {
if (!$pass) {
$this->verbose($this->stringToHtml($output));
}
$output_upper = drupal_strtoupper($output);
$upper_input = drupal_strtoupper($input);
$output_upper = Unicode::strtoupper($output);
$upper_input = Unicode::strtoupper($input);
$upper_output = drupal_html_to_text($upper_input);
$pass = $this->assertEqual(
$upper_output,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment