From 7adb6cd9341da2ddde43153f15d4bee11686c855 Mon Sep 17 00:00:00 2001
From: Philipp Gampe <philipp.gampe@typo3.org>
Date: Sat, 7 Dec 2013 12:51:27 +0100
Subject: [PATCH] [!!!][BUGFIX] Do not use explicit reference for objects

The ToolbarItemHookInterface expects the parameter to be passed by
reference. This broke in PHP 5.5.6. The reference operator is not
needed, because an object is expected that must always be a reference.

!!! Changing the interface breaks all extensions implementing it to
add toolbar items to the backend.

Resolves: #53682
Releases: 6.2, 6.1, 6.0, 4.5
Change-Id: Ie02a878ea2b9204364799144b0f3b37d351afd58
---
 typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php          | 2 +-
 typo3/sysext/backend/Classes/Toolbar/LiveSearchToolbarItem.php          | 2 +-
 typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php            | 2 +-
 typo3/sysext/backend/Classes/Toolbar/ToolbarItemHookInterface.php       | 2 +-
 typo3/sysext/opendocs/Classes/Controller/OpendocsController.php         | 2 +-
 typo3/sysext/sys_action/Classes/ActionToolbarMenu.php                   | 2 +-
 .../workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php       | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php b/typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php
index 8e27c52..89596f0 100644
--- a/typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php
+++ b/typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php
@@ -60,7 +60,7 @@ class ClearCacheToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHoo
 	 *
 	 * @param \TYPO3\CMS\Backend\Controller\BackendController $backendReference TYPO3 backend object reference
 	 */
-	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController &$backendReference = NULL) {
+	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController $backendReference = NULL) {
 		$this->backendReference = $backendReference;
 		$this->cacheActions = array();
 		$this->optionValues = array('all', 'pages');
diff --git a/typo3/sysext/backend/Classes/Toolbar/LiveSearchToolbarItem.php b/typo3/sysext/backend/Classes/Toolbar/LiveSearchToolbarItem.php
index 0dc79c1..6c5a6b2 100644
--- a/typo3/sysext/backend/Classes/Toolbar/LiveSearchToolbarItem.php
+++ b/typo3/sysext/backend/Classes/Toolbar/LiveSearchToolbarItem.php
@@ -47,7 +47,7 @@ class LiveSearchToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHoo
 	 *
 	 * @param \TYPO3\CMS\Backend\Controller\BackendController $backendReference TYPO3 backend object reference
 	 */
-	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController &$backendReference = NULL) {
+	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController $backendReference = NULL) {
 		$this->backendReference = $backendReference;
 	}
 
diff --git a/typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php b/typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php
index 3bf09eb..06b221b 100644
--- a/typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php
+++ b/typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php
@@ -68,7 +68,7 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
 	 *
 	 * @param \TYPO3\CMS\Backend\Controller\BackendController $backendReference TYPO3 backend object reference
 	 */
-	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController &$backendReference = NULL) {
+	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController $backendReference = NULL) {
 		if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
 			$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xlf');
 			// Needed to get the correct icons when reloading the menu after saving it
diff --git a/typo3/sysext/backend/Classes/Toolbar/ToolbarItemHookInterface.php b/typo3/sysext/backend/Classes/Toolbar/ToolbarItemHookInterface.php
index 3c11017..e95cd02 100644
--- a/typo3/sysext/backend/Classes/Toolbar/ToolbarItemHookInterface.php
+++ b/typo3/sysext/backend/Classes/Toolbar/ToolbarItemHookInterface.php
@@ -37,7 +37,7 @@ interface ToolbarItemHookInterface {
 	 *
 	 * @param \TYPO3\CMS\Backend\Controller\BackendController $backendReference TYPO3 backend object reference
 	 */
-	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController &$backendReference = NULL);
+	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController $backendReference = NULL);
 
 	/**
 	 * Checks whether the user has access to this toolbar item
diff --git a/typo3/sysext/opendocs/Classes/Controller/OpendocsController.php b/typo3/sysext/opendocs/Classes/Controller/OpendocsController.php
index e5c437e..b6fc15b 100644
--- a/typo3/sysext/opendocs/Classes/Controller/OpendocsController.php
+++ b/typo3/sysext/opendocs/Classes/Controller/OpendocsController.php
@@ -53,7 +53,7 @@ class OpendocsController implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookIn
 	 *
 	 * @param \TYPO3\CMS\Backend\Controller\BackendController TYPO3 backend object reference
 	 */
-	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController &$backendReference = NULL) {
+	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController $backendReference = NULL) {
 		$GLOBALS['LANG']->includeLLFile('EXT:opendocs/locallang_opendocs.xlf');
 		$this->backendReference = $backendReference;
 		$this->loadDocsFromUserSession();
diff --git a/typo3/sysext/sys_action/Classes/ActionToolbarMenu.php b/typo3/sysext/sys_action/Classes/ActionToolbarMenu.php
index a6fa949..43989ab 100644
--- a/typo3/sysext/sys_action/Classes/ActionToolbarMenu.php
+++ b/typo3/sysext/sys_action/Classes/ActionToolbarMenu.php
@@ -46,7 +46,7 @@ class ActionToolbarMenu implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInt
 	/**
 	 * Constructor
 	 */
-	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController &$backendReference = NULL) {
+	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController $backendReference = NULL) {
 		$GLOBALS['LANG']->includeLLFile('EXT:sys_action/locallang.xlf');
 		$this->backendReference = $backendReference;
 	}
diff --git a/typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php b/typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php
index 7b7d574..6a8c2b0 100644
--- a/typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php
+++ b/typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php
@@ -59,7 +59,7 @@ class WorkspaceSelectorToolbarItem implements \TYPO3\CMS\Backend\Toolbar\Toolbar
 	 *
 	 * @param \TYPO3\CMS\Backend\Controller\BackendController TYPO3 backend object reference
 	 */
-	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController &$backendReference = NULL) {
+	public function __construct(\TYPO3\CMS\Backend\Controller\BackendController $backendReference = NULL) {
 		$this->backendReference = $backendReference;
 		$this->changeWorkspace = GeneralUtility::_GP('changeWorkspace');
 		$this->changeWorkspacePreview = GeneralUtility::_GP('changeWorkspacePreview');
-- 
1.8.3.1

