]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove 32-bit workarounds
authorszaimen <szaimen@e.mail.de>
Tue, 1 Nov 2022 13:03:48 +0000 (14:03 +0100)
committerszaimen <szaimen@e.mail.de>
Wed, 2 Nov 2022 10:13:34 +0000 (11:13 +0100)
Signed-off-by: szaimen <szaimen@e.mail.de>
lib/private/Files/Storage/Local.php
lib/private/Setup.php
lib/private/Streamer.php
lib/private/legacy/OC_Response.php

index ff157bfe7f6379c493a246aa5eb8ee8dc70d854b..0c5375c02409721834ed9e81386707511d60746b 100644 (file)
@@ -170,11 +170,6 @@ class Local extends \OC\Files\Storage\Common {
                        return false;
                }
                $statResult = @stat($fullPath);
-               if (PHP_INT_SIZE === 4 && $statResult && !$this->is_dir($path)) {
-                       $filesize = $this->filesize($path);
-                       $statResult['size'] = $filesize;
-                       $statResult[7] = $filesize;
-               }
                if (is_array($statResult)) {
                        $statResult['full_path'] = $fullPath;
                }
@@ -246,10 +241,6 @@ class Local extends \OC\Files\Storage\Common {
                        return 0;
                }
                $fullPath = $this->getSourcePath($path);
-               if (PHP_INT_SIZE === 4) {
-                       $helper = new \OC\LargeFileHelper;
-                       return $helper->getFileSize($fullPath);
-               }
                return filesize($fullPath);
        }
 
@@ -271,10 +262,6 @@ class Local extends \OC\Files\Storage\Common {
                if (!$this->file_exists($path)) {
                        return false;
                }
-               if (PHP_INT_SIZE === 4) {
-                       $helper = new \OC\LargeFileHelper();
-                       return $helper->getFileMtime($fullPath);
-               }
                return filemtime($fullPath);
        }
 
index 3b79b31b84997e52a634d5c17337c127f261d6d7..7b08fb2f66fd24ef23f97b116f6b557afb5e98a2 100644 (file)
@@ -247,14 +247,13 @@ class Setup {
                        ];
                }
 
-               if ($this->iniWrapper->getString('open_basedir') !== '' && PHP_INT_SIZE === 4) {
+               if (PHP_INT_SIZE < 8) {
                        $errors[] = [
                                'error' => $this->l10n->t(
-                                       'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. ' .
-                                       'This will lead to problems with files over 4 GB and is highly discouraged.',
+                                       'It seems that this %s instance is running on a 32-bit PHP environment. 64-bit is required for 26 and higher.',
                                        [$this->defaults->getProductName()]
                                ),
-                               'hint' => $this->l10n->t('Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP.'),
+                               'hint' => $this->l10n->t('Please switch to 64-bit PHP.'),
                        ];
                }
 
index 88204be980565e154aa7b210c8a6ac5f0e23428a..db7d0024b5a4f915528d9fe8ba28aa5bb6950ee3 100644 (file)
@@ -86,7 +86,7 @@ class Streamer {
                } elseif ($request->isUserAgent($this->preferTarFor)) {
                        $this->streamerInstance = new TarStreamer();
                } else {
-                       $this->streamerInstance = new ZipStreamer(['zip64' => PHP_INT_SIZE !== 4]);
+                       $this->streamerInstance = new ZipStreamer(['zip64' => true]);
                }
        }
 
index e4525fe9e101b89ba467fb2ec57146bf871a48f8..b849710e90b6d0d6867f9d98a9212a8ac9218494 100644 (file)
@@ -52,19 +52,6 @@ class OC_Response {
         * @param string|int|float $length Length to be sent
         */
        public static function setContentLengthHeader($length) {
-               if (PHP_INT_SIZE === 4) {
-                       if ($length > PHP_INT_MAX && stripos(PHP_SAPI, 'apache') === 0) {
-                               // Apache PHP SAPI casts Content-Length headers to PHP integers.
-                               // This enforces a limit of PHP_INT_MAX (2147483647 on 32-bit
-                               // platforms). So, if the length is greater than PHP_INT_MAX,
-                               // we just do not send a Content-Length header to prevent
-                               // bodies from being received incompletely.
-                               return;
-                       }
-                       // Convert signed integer or float to unsigned base-10 string.
-                       $lfh = new \OC\LargeFileHelper;
-                       $length = $lfh->formatUnsignedInteger($length);
-               }
                header('Content-Length: '.$length);
        }