Skip to content
Snippets Groups Projects
Commit b9073084 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Remove last mentions of t3lib_formmail

Change-Id: I7774323581f97bd3562eaa1fa67a5faae748446a
Resolves: #47160
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/19834
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-on: https://review.typo3.org/19836
parent 90c30382
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,6 @@
// This file was generated on 2012-06-22 14:48
$t3libClasses = array(
't3lib_ajax' => PATH_t3lib . 'class.t3lib_ajax.php',
't3lib_formmail' => PATH_t3lib . 'class.t3lib_formmail.php',
't3lib_install' => PATH_t3lib . 'class.t3lib_install.php',
't3lib_readmail' => PATH_t3lib . 'class.t3lib_readmail.php',
't3lib_syntaxhl' => PATH_t3lib . 'class.t3lib_syntaxhl.php',
......@@ -22,4 +21,4 @@ $typo3Classes = array(
'transferdata' => PATH_typo3 . 'show_item.php',
);
return array_merge($t3libClasses, $typo3Classes);
?>
\ No newline at end of file
?>
......@@ -137,7 +137,7 @@ class DataSubmissionController {
$autoRespondChecksum = $valueList['auto_respond_checksum'];
$correctHmacChecksum = Utility\GeneralUtility::hmac($this->autoRespondMessage);
if ($autoRespondChecksum !== $correctHmacChecksum) {
Utility\GeneralUtility::sysLog('Possible misuse of t3lib_formmail auto respond method. Subject: ' . $valueList['subject'], 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
Utility\GeneralUtility::sysLog('Possible misuse of DataSubmissionController auto respond method. Subject: ' . $valueList['subject'], 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
return;
} else {
$this->autoRespondMessage = $this->sanitizeHeaderString($this->autoRespondMessage);
......@@ -173,10 +173,10 @@ class DataSubmissionController {
continue;
}
if (!is_uploaded_file($_FILES[$variableName]['tmp_name'])) {
Utility\GeneralUtility::sysLog('Possible abuse of t3lib_formmail: temporary file "' . $_FILES[$variableName]['tmp_name'] . '" ("' . $_FILES[$variableName]['name'] . '") was not an uploaded file.', 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
Utility\GeneralUtility::sysLog('Possible abuse of DataSubmissionController: temporary file "' . $_FILES[$variableName]['tmp_name'] . '" ("' . $_FILES[$variableName]['name'] . '") was not an uploaded file.', 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
}
if ($_FILES[$variableName]['tmp_name']['error'] !== UPLOAD_ERR_OK) {
Utility\GeneralUtility::sysLog('Error in uploaded file in t3lib_formmail: temporary file "' . $_FILES[$variableName]['tmp_name'] . '" ("' . $_FILES[$variableName]['name'] . '") Error code: ' . $_FILES[$variableName]['tmp_name']['error'], 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
Utility\GeneralUtility::sysLog('Error in uploaded file in DataSubmissionController: temporary file "' . $_FILES[$variableName]['tmp_name'] . '" ("' . $_FILES[$variableName]['name'] . '") Error code: ' . $_FILES[$variableName]['tmp_name']['error'], 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
}
$theFile = Utility\GeneralUtility::upload_to_tempfile($_FILES[$variableName]['tmp_name']);
$theName = $_FILES[$variableName]['name'];
......@@ -201,9 +201,9 @@ class DataSubmissionController {
// is not worth the trouble
// Log dirty header lines
if ($this->dirtyHeaders) {
Utility\GeneralUtility::sysLog('Possible misuse of t3lib_formmail: see TYPO3 devLog', 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
Utility\GeneralUtility::sysLog('Possible misuse of DataSubmissionController: see TYPO3 devLog', 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_DLOG']) {
Utility\GeneralUtility::devLog('t3lib_formmail: ' . Utility\GeneralUtility::arrayToLogString($this->dirtyHeaders, '', 200), 'Core', 3);
Utility\GeneralUtility::devLog('DataSubmissionController: ' . Utility\GeneralUtility::arrayToLogString($this->dirtyHeaders, '', 200), 'Core', 3);
}
}
}
......@@ -290,4 +290,4 @@ class DataSubmissionController {
}
?>
\ No newline at end of file
?>
<?php
namespace TYPO3\CMS\Frontend\Tests\Unit\Controller;
/***************************************************************
* Copyright notice
*
......@@ -23,14 +25,11 @@
***************************************************************/
/**
* Testcase for t3lib_formmail
*
* This legacy test will be removed if t3lib_formmail is removed
* Test case
*
* @author Christian Kuhn <lolli@schwarzbu.ch>
*
*/
class t3lib_formmailTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
class DataSubmissionControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
///////////////////////////////
// tests concerning __destruct
......@@ -41,7 +40,7 @@ class t3lib_formmailTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
*/
public function invalidFileReferences() {
return array(
'not within PATH_site' => array('/tmp/TYPO3-Formmail-Test'),
'not within PATH_site' => array('/tmp/TYPO3-DataSubmissionControllerTest'),
'does not start with upload_temp_' => array(PATH_site . 'typo3temp/foo'),
'directory traversal' => array(PATH_site . 'typo3temp/../typo3temp/upload_temp_foo'),
);
......@@ -66,9 +65,8 @@ class t3lib_formmailTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
$this->markTestSkipped('destructorDoesNotRemoveFilesNotWithinTypo3TempDirectory() skipped: Test file could not be created');
}
// Create t3lib_formmail instance, inject invalid file
$instance = new t3lib_formmail(999999999, $lockMethod);
$t3libLockReflection = new ReflectionClass('t3lib_formmail');
$instance = new \TYPO3\CMS\Frontend\Controller\DataSubmissionController(999999999, $lockMethod);
$t3libLockReflection = new \ReflectionClass('TYPO3\\CMS\\Frontend\\Controller\\DataSubmissionController');
$t3libLockReflectionResourceProperty = $t3libLockReflection->getProperty('temporaryFiles');
$t3libLockReflectionResourceProperty->setAccessible(TRUE);
$t3libLockReflectionResourceProperty->setValue($instance, array($file));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment