summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-01-22 03:29:01 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-01-22 03:29:01 +0000
commit096309b327b0cf9e8637aadac494860774dc7549 (patch)
tree7899b0a8f739dfe6cd5839e444075f7c00e0ab3d /includes
parentafc9df994a10a2af320f21fe87f47f10315dd28b (diff)
downloadbrdo-096309b327b0cf9e8637aadac494860774dc7549.tar.gz
brdo-096309b327b0cf9e8637aadac494860774dc7549.tar.bz2
#352121 by valthebald and Damien Tournoud: Allow importing of invalid tags in .po files into non-default text groups.
Diffstat (limited to 'includes')
-rw-r--r--includes/locale.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/locale.inc b/includes/locale.inc
index 4b9ce34ea..74b6efc7d 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -856,8 +856,10 @@ function locale_string_is_safe($string) {
* Validate string editing form submissions.
*/
function locale_translate_edit_form_validate($form, &$form_state) {
+ // Locale string check is needed for default textgroup only.
+ $safe_check_needed = $form_state['values']['textgroup'] == 'default';
foreach ($form_state['values']['translations'] as $key => $value) {
- if (!locale_string_is_safe($value)) {
+ if ($safe_check_needed && !locale_string_is_safe($value)) {
form_set_error('translations', t('The submitted string contains disallowed HTML: %string', array('%string' => $value)));
watchdog('locale', 'Attempted submission of a translation string with disallowed HTML: %string', array('%string' => $value), WATCHDOG_WARNING);
}
@@ -1349,7 +1351,9 @@ function _locale_import_one_string_db(&$report, $langcode, $source, $translation
if (!empty($translation)) {
// Skip this string unless it passes a check for dangerous code.
- if (!locale_string_is_safe($translation)) {
+ // Text groups other than default still can contain HTML tags
+ // (i.e. translatable blocks).
+ if ($textgroup == "default" && !locale_string_is_safe($translation)) {
$report['skips']++;
$lid = 0;
}