diff options
author | Simon Rettberg | 2018-02-13 15:44:09 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-02-13 15:44:09 +0100 |
commit | cbf344a26ed449040bb6287810bc87d5f6911e4c (patch) | |
tree | 8b48af91ea83cd2efef80ca8f884cbfc9949a000 /modules-available/translation/page.inc.php | |
parent | [permissionmanager] Add global translation plugin (diff) | |
download | slx-admin-cbf344a26ed449040bb6287810bc87d5f6911e4c.tar.gz slx-admin-cbf344a26ed449040bb6287810bc87d5f6911e4c.tar.xz slx-admin-cbf344a26ed449040bb6287810bc87d5f6911e4c.zip |
[translation] Fix saving language tags containing dots
Diffstat (limited to 'modules-available/translation/page.inc.php')
-rw-r--r-- | modules-available/translation/page.inc.php | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/modules-available/translation/page.inc.php b/modules-available/translation/page.inc.php index e41d4786..df7bc15e 100644 --- a/modules-available/translation/page.inc.php +++ b/modules-available/translation/page.inc.php @@ -997,24 +997,19 @@ class Page_Translation extends Page $data = array(); //find the tag requests to change the file - foreach ($_POST as $key => $value) { - $str = explode('#!#', $key, 2); - if (count($str) !== 2) + $tags = Request::post('langtag', array(), 'array'); + foreach ($tags as $tag => $value) { + $tag = trim($tag); + if (empty($tag)) { + Message::addWarning('i18n-empty-tag'); continue; - if ($str[0] === 'lang') { - $tag = trim($str[1]); - if (empty($tag)) { - Message::addWarning('i18n-empty-tag'); - continue; - } - if (empty($value)) { - unset($data[$tag]); - } else { - $data[$tag] = $value; - } + } + if (empty($value)) { + unset($data[$tag]); + } else { + $data[$tag] = $value; } } - $translation = Request::post('new-text', array(), 'array'); foreach (Request::post('new-id', array(), 'array') as $k => $tag) { if (empty($translation[$k]) || empty($tag)) |