summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc36
1 files changed, 15 insertions, 21 deletions
diff --git a/includes/common.inc b/includes/common.inc
index ffe4b0574..21b19f9e5 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -633,32 +633,26 @@ function t($string, $args = 0) {
}
else {
// Transform arguments before inserting them
- array_walk($args, '_t');
+ foreach($args as $key => $value) {
+ switch ($key[0]) {
+ // Escaped only
+ case '@':
+ $args[$key] = check_plain($value);
+ break;
+ // Escaped and placeholder
+ case '%':
+ default:
+ $args[$key] = theme('placeholder', $value);
+ break;
+ // Pass-through
+ case '!':
+ }
+ }
return strtr($string, $args);
}
}
/**
- * Helper function: apply the appropriate transformation to st() and t()
- * placeholders.
- */
-function _t(&$value, $key) {
- switch ($key[0]) {
- // Escaped only
- case '@':
- $value = check_plain($value);
- return;
- // Escaped and placeholder
- case '%':
- default:
- $value = theme('placeholder', $value);
- return;
- // Pass-through
- case '!':
- }
-}
-
-/**
* @defgroup validation Input validation
* @{
* Functions to validate user input.