You are here

function _locale_strip_quotes in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/locale/locale.module \_locale_strip_quotes()
  2. 10 core/modules/locale/locale.module \_locale_strip_quotes()

Removes the quotes and string concatenations from the string.

Parameters

string $string: Single or double quoted strings, optionally concatenated by plus (+) sign.

Return value

string String with leading and trailing quotes removed.

1 call to _locale_strip_quotes()
_locale_parse_js_file in core/modules/locale/locale.module
Parses a JavaScript file, extracts strings wrapped in Drupal.t() and Drupal.formatPlural() and inserts them into the database.

File

core/modules/locale/locale.module, line 1086
Enables the translation of the user interface to languages other than English.

Code

function _locale_strip_quotes($string) {
  return implode('', preg_split('~(?<!\\\\)[\'"]\\s*\\+\\s*[\'"]~s', substr($string, 1, -1)));
}