[BUGFIX] Computed properties are queried in workspace context 91/45491/2
authorOliver Hader <oliver@typo3.org>
Tue, 29 Dec 2015 15:58:50 +0000 (16:58 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 30 Dec 2015 15:46:11 +0000 (16:46 +0100)
This is a follow-up to issue #68643 to sanitize all places that
reuse the fields (including the computed properties) of a record.

Resolves: #66135
Releases: master, 7.6, 6.2
Change-Id: Ifb57193ff07e3d9ddae50568a0dce741f9aaf12d
Reviewed-on: https://review.typo3.org/45491
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/frontend/Classes/Page/PageRepository.php

index 0940ff9..9d44964 100644 (file)
@@ -361,7 +361,7 @@ class PageRepository {
                                // Was the whole record
                                $page_id = $pageInput['uid'];
                                // Make sure that only fields which exist in the incoming record are overlaid!
-                               $fieldArr = array_intersect($fieldArr, array_keys($pageInput));
+                               $fieldArr = array_intersect($fieldArr, array_keys($this->purgeComputedProperties($pageInput)));
                        } else {
                                // Was the id
                                $page_id = $pageInput;
@@ -1239,7 +1239,7 @@ class PageRepository {
                        }
                        // Find pointed-to record.
                        if ($moveID) {
-                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(implode(',', array_keys($row)), $table, 'uid=' . (int)$moveID . $this->enableFields($table));
+                               $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(implode(',', array_keys($this->purgeComputedProperties($row))), $table, 'uid=' . (int)$moveID . $this->enableFields($table));
                                $origRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
                                $GLOBALS['TYPO3_DB']->sql_free_result($res);
                                if ($origRow) {