summaryrefslogtreecommitdiffstats
path: root/lib/private/IntegrityCheck
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-02-28 11:05:28 +0100
committerMorris Jobke <hey@morrisjobke.de>2019-03-04 12:14:22 +0100
commitc6a69ba92514587814d0f03b51e1d1f026a49350 (patch)
treeb7162fff445ea0595280b535b95a60b689f742dd /lib/private/IntegrityCheck
parent814bf0de20b05ef44d4558d49cc3dc655da1c58d (diff)
downloadnextcloud-server-c6a69ba92514587814d0f03b51e1d1f026a49350.tar.gz
nextcloud-server-c6a69ba92514587814d0f03b51e1d1f026a49350.zip
Remove the upload and memory setting
* Remove unneeded private method phpFileSize() * Bump autoloader * Remove setUploadLimit tests * Remove integrity check hacks for upload limit Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/IntegrityCheck')
-rw-r--r--lib/private/IntegrityCheck/Checker.php34
1 files changed, 1 insertions, 33 deletions
diff --git a/lib/private/IntegrityCheck/Checker.php b/lib/private/IntegrityCheck/Checker.php
index 44544b6770e..0a8876381f4 100644
--- a/lib/private/IntegrityCheck/Checker.php
+++ b/lib/private/IntegrityCheck/Checker.php
@@ -158,8 +158,6 @@ class Checker {
private function generateHashes(\RecursiveIteratorIterator $iterator,
string $path): array {
$hashes = [];
- $copiedWebserverSettingFiles = false;
- $tmpFolder = '';
$baseDirectoryLength = \strlen($path);
foreach($iterator as $filename => $data) {
@@ -180,36 +178,6 @@ class Checker {
continue;
}
- // The .user.ini and the .htaccess file of ownCloud can contain some
- // custom modifications such as for example the maximum upload size
- // to ensure that this will not lead to false positives this will
- // copy the file to a temporary folder and reset it to the default
- // values.
- if($filename === $this->environmentHelper->getServerRoot() . '/.htaccess'
- || $filename === $this->environmentHelper->getServerRoot() . '/.user.ini') {
-
- if(!$copiedWebserverSettingFiles) {
- $tmpFolder = rtrim($this->tempManager->getTemporaryFolder(), '/');
- copy($this->environmentHelper->getServerRoot() . '/.htaccess', $tmpFolder . '/.htaccess');
- copy($this->environmentHelper->getServerRoot() . '/.user.ini', $tmpFolder . '/.user.ini');
- \OC_Files::setUploadLimit(
- \OCP\Util::computerFileSize('511MB'),
- [
- '.htaccess' => $tmpFolder . '/.htaccess',
- '.user.ini' => $tmpFolder . '/.user.ini',
- ]
- );
- }
- }
-
- // The .user.ini file can contain custom modifications to the file size
- // as well.
- if($filename === $this->environmentHelper->getServerRoot() . '/.user.ini') {
- $fileContent = file_get_contents($tmpFolder . '/.user.ini');
- $hashes[$relativeFileName] = hash('sha512', $fileContent);
- continue;
- }
-
// The .htaccess file in the root folder of ownCloud can contain
// custom content after the installation due to the fact that dynamic
// content is written into it at installation time as well. This
@@ -218,7 +186,7 @@ class Checker {
// "#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####" and have the
// hash generated based on this.
if($filename === $this->environmentHelper->getServerRoot() . '/.htaccess') {
- $fileContent = file_get_contents($tmpFolder . '/.htaccess');
+ $fileContent = file_get_contents($filename);
$explodedArray = explode('#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####', $fileContent);
if(\count($explodedArray) === 2) {
$hashes[$relativeFileName] = hash('sha512', $explodedArray[0]);