From: Felix Kopp Date: Sun, 25 Nov 2012 14:53:57 +0000 (+0100) Subject: [BUGFIX] Obey option SYS: loginCopyrightShowVersion X-Git-Tag: TYPO3_6-0-0~40 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/b9520fb8724c0eb86de6b952725f899b87fedfde [BUGFIX] Obey option SYS: loginCopyrightShowVersion Due to a bug introduced in #41992 the current version number is always displayed within copyright notice underneath login form. Change-Id: I9a0c48183eb0f56a1303cedf31ed13ff1c78c41b Fixes: #43289 Releases: 6.0 Reviewed-on: http://review.typo3.org/16729 Reviewed-by: Wouter Wolters Reviewed-by: Steffen Ritter Tested-by: Steffen Ritter Reviewed-by: Helmut Hummel Tested-by: Helmut Hummel --- diff --git a/typo3/sysext/backend/Classes/Controller/LoginController.php b/typo3/sysext/backend/Classes/Controller/LoginController.php index 51e77c34ed13..62727094f767 100644 --- a/typo3/sysext/backend/Classes/Controller/LoginController.php +++ b/typo3/sysext/backend/Classes/Controller/LoginController.php @@ -287,7 +287,7 @@ class LoginController { 'LOGINBOX_IMAGE' => $this->makeLoginBoxImage(), 'FORM' => $content, 'NEWS' => $this->makeLoginNews(), - 'COPYRIGHT' => \TYPO3\CMS\Backend\Utility\BackendUtility::TYPO3_copyRightNotice(), + 'COPYRIGHT' => \TYPO3\CMS\Backend\Utility\BackendUtility::TYPO3_copyRightNotice($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightShowVersion']), 'CSS_CLASSES' => !empty($additionalCssClasses) ? 'class="' . implode(' ', $additionalCssClasses) . '"' : '', 'CSS_OPENIDCLASS' => 't3-login-openid-' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('openid') ? 'enabled' : 'disabled'), // The labels will be replaced later on, thus the other parts above diff --git a/typo3/sysext/backend/Classes/Utility/BackendUtility.php b/typo3/sysext/backend/Classes/Utility/BackendUtility.php index 4d719a4bb14c..ff6db7472b72 100644 --- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php +++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php @@ -3796,12 +3796,18 @@ class BackendUtility { * According to the GPL license an interactive application must show such a notice on start-up ('If the program is interactive, make it output a short notice... ' - see GPL.txt) * Therefore preventing this notice from being properly shown is a violation of the license, regardless of whether you remove it or use a stylesheet to obstruct the display. * + * @param boolean Display the version number within the copyright notice? * @return string Text/Image (HTML) for copyright notice. */ - static public function TYPO3_copyRightNotice() { + static public function TYPO3_copyRightNotice($showVersionNumber = TRUE) { // Copyright Notice $loginCopyrightWarrantyProvider = strip_tags(trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyProvider'])); $loginCopyrightWarrantyURL = strip_tags(trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['loginCopyrightWarrantyURL'])); + + $versionNumber = $showVersionNumber ? + ' ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_login.xml:version.short') . ' ' . + htmlspecialchars(TYPO3_version) : ''; + if (strlen($loginCopyrightWarrantyProvider) >= 2 && strlen($loginCopyrightWarrantyURL) >= 10) { $warrantyNote = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_login.xml:warranty.by'), htmlspecialchars($loginCopyrightWarrantyProvider), '', ''); } else { @@ -3809,9 +3815,7 @@ class BackendUtility { } $cNotice = '' . '' . - $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_login.xml:typo3.cms') . ' ' . - $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_login.xml:version.short') . ' ' . - htmlspecialchars(TYPO3_version) . '. ' . + $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_login.xml:typo3.cms') . $versionNumber . '. ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_login.xml:copyright') . ' © ' . htmlspecialchars(TYPO3_copyright_year) . ' Kasper Skårhøj. ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_login.xml:extension.copyright') . ' ' . sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_login.xml:details.link'), ('' . TYPO3_URL_GENERAL . '')) . ' ' .