Remove unnecessary PHP version checks
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 19 May 2015 21:18:39 +0000 (23:18 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 19 May 2015 21:18:39 +0000 (23:18 +0200)
wcfsetup/install/files/lib/system/io/Tar.class.php
wcfsetup/install/files/lib/system/mail/Mail.class.php
wcfsetup/install/files/lib/util/PasswordUtil.class.php

index 249b26d444e5688f2ec3b779648c477d28b993ab..26377be43e8e60a05ff6c5800ec7476dd3ed030a 100644 (file)
@@ -264,12 +264,7 @@ class Tar implements IArchive {
                                $longFilename = null;
                        }
                        if ($header['typeflag'] == 'L') {
-                               if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) {
-                                       $format = 'Z'.$header['size'].'filename';
-                               }
-                               else {
-                                       $format = 'a'.$header['size'].'filename';
-                               }
+                               $format = 'Z'.$header['size'].'filename';
                                
                                $fileData = unpack($format, $this->file->read(512));
                                $longFilename = $fileData['filename'];
@@ -314,12 +309,7 @@ class Tar implements IArchive {
                }
                
                // extract values
-               if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) {
-                       $format = 'Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1typeflag/Z100link/Z6magic/Z2version/Z32uname/Z32gname/Z8devmajor/Z8devminor/Z155prefix';
-               }
-               else {
-                       $format = 'a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor/a155prefix';
-               }
+               $format = 'Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1typeflag/Z100link/Z6magic/Z2version/Z32uname/Z32gname/Z8devmajor/Z8devminor/Z155prefix';
                
                $data = unpack($format, $binaryData);
                
index c6bb84a33d4f188165229063a25ec4914d05f31f..d695a1c6f741e4ffe9459cd88df9c739a252143f 100644 (file)
@@ -159,11 +159,7 @@ class Mail {
                        $this->header .= 'Content-Type: '.$this->getContentType().'; charset=UTF-8'.self::$lineEnding;
                }
                
-               // until PHP 5.3.4 mb_send_mail() appends an extra MIME-Version header
-               // @see: https://bugs.php.net/bug.php?id=52681
-               if (MAIL_SEND_METHOD != 'php' || version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION, '5.3.4', '>=')) {
-                       $this->header .= 'MIME-Version: 1.0'.self::$lineEnding;
-               }
+               $this->header .= 'MIME-Version: 1.0'.self::$lineEnding;
                
                return $this->header;
        }
index 013926e4169e420af47c99bf60f562127e89dc22..2a5fdf74204ab21f1c3560159049755e0db6b1ef 100644 (file)
@@ -254,9 +254,6 @@ final class PasswordUtil {
        /**
         * Generates secure random numbers using OpenSSL.
         * 
-        * This method forces mt_rand() if PHP versions below 5.4.0 are used due to a bug
-        * causing up to 15 seconds delay until the bytes are returned.
-        * 
         * @see         http://de1.php.net/manual/en/function.openssl-random-pseudo-bytes.php#104322
         * @param       integer         $min
         * @param       integer         $max
@@ -270,7 +267,7 @@ final class PasswordUtil {
                }
                
                // fallback to mt_rand() if OpenSSL is not available
-               if (version_compare(PHP_VERSION, '5.4.0-dev', '<') || !function_exists('openssl_random_pseudo_bytes')) {
+               if (!function_exists('openssl_random_pseudo_bytes')) {
                        return mt_rand($min, $max);
                }