[BUGFIX] Translated mailform should use localized email
authorMichael Stucki <michael.stucki@typo3.org>
Sun, 15 Jan 2012 22:09:10 +0000 (23:09 +0100)
committerXavier Perseguers <xavier@typo3.org>
Tue, 6 Mar 2012 09:58:25 +0000 (10:58 +0100)
In case mailforms are translated the email adress from the
translated record is ignored.

Change-Id: I55913d42815f7da53a05b3bfd635b589ecc3f1ae
Fixes: #17061
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/8957
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/cms/tslib/content/class.tslib_content_form.php

index ce8219b..7b44f10 100644 (file)
@@ -797,8 +797,12 @@ class tslib_content_Form extends tslib_content_Abstract {
                        if ($location == 'HTTP_POST_VARS' && isset($_POST['locationData'])) {
                                $locationData = t3lib_div::_POST('locationData');
                        } else {
-                                       // locationData is [hte page id]:[tablename]:[uid of record]. Indicates on which page the record (from tablename with uid) is shown. Used to check access.
-                               $locationData = $GLOBALS['TSFE']->id . ':' . $this->cObj->currentRecord;
+                                       // locationData is [the page id]:[tablename]:[uid of record]. Indicates on which page the record (from tablename with uid) is shown. Used to check access.
+                               if (isset($this->data['_LOCALIZED_UID'])) {
+                                       $locationData = $GLOBALS['TSFE']->id . ':' . str_replace($this->data['uid'], $this->data['_LOCALIZED_UID'], $this->cObj->currentRecord);
+                               } else {
+                                       $locationData = $GLOBALS['TSFE']->id . ':' . $this->cObj->currentRecord;
+                               }
                        }
                        $hiddenfields .= '<input type="hidden" name="locationData" value="' . htmlspecialchars($locationData) . '" />';
                }