Commit 7f5bc4e9 authored by alexpott's avatar alexpott
Browse files

Issue #2397225 by Chi, ufku: Drupal.formatPlural does not work

parent 3e275d65
...@@ -214,26 +214,29 @@ if (window.jQuery) { ...@@ -214,26 +214,29 @@ if (window.jQuery) {
* @ingroup sanitization * @ingroup sanitization
*/ */
Drupal.formatString = function (str, args) { Drupal.formatString = function (str, args) {
// Keep args intact.
var processedArgs = {};
// Transform arguments before inserting them. // Transform arguments before inserting them.
for (var key in args) { for (var key in args) {
if (args.hasOwnProperty(key)) { if (args.hasOwnProperty(key)) {
switch (key.charAt(0)) { switch (key.charAt(0)) {
// Escaped only. // Escaped only.
case '@': case '@':
args[key] = Drupal.checkPlain(args[key]); processedArgs[key] = Drupal.checkPlain(args[key]);
break; break;
// Pass-through. // Pass-through.
case '!': case '!':
processedArgs[key] = args[key];
break; break;
// Escaped and placeholder. // Escaped and placeholder.
default: default:
args[key] = Drupal.theme('placeholder', args[key]); processedArgs[key] = Drupal.theme('placeholder', args[key]);
break; break;
} }
} }
} }
return Drupal.stringReplace(str, args, null); return Drupal.stringReplace(str, processedArgs, null);
}; };
/** /**
......
Supports Markdown
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