Fixed bug #11266: Remove initialization of the random number generator
authorOliver Hader <oliver.hader@typo3.org>
Fri, 12 Jun 2009 10:53:32 +0000 (10:53 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Fri, 12 Jun 2009 10:53:32 +0000 (10:53 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5583 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/index.php
typo3/mod/tools/em/class.em_index.php
typo3/sysext/cms/tslib/class.tslib_fe.php

index 1637312..536ae3d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Fixed bug #11272: Autoloader floads sysLog with XCLASS failures
        * Follow-up to feature #11314: Removed hardcoded length of a session ID
+       * Fixed bug #11266: Remove initialization of the random number generator
 
 2009-06-10  Oliver Hader  <oliver@typo3.org>
 
index 11b2145..95c4c28 100644 (file)
@@ -500,7 +500,6 @@ class SC_index {
                                $files = t3lib_div::getFilesInDir($dir,'png,jpg,gif');
 
                                        // Pick random file:
-                               srand((float) microtime() * 10000000);
                                $randImg = array_rand($files, 1);
 
                                        // Get size of random file:
index e5e97c5..ec545ee 100644 (file)
@@ -1612,7 +1612,6 @@ EXTENSION KEYS:
                        if(!is_array($mirrors)) return false;
                }
                if($this->MOD_SETTINGS['selectedMirror']=='') {
-                       srand((float) microtime() * 10000000); // not needed after PHP 4.2.0...
                        $rand = array_rand($mirrors);
                        $url = 'http://'.$mirrors[$rand]['host'].$mirrors[$rand]['path'];
                }
index 78eefe9..706882f 100644 (file)
                                $pageArray = $this->sys_page->getMenu($idArray[0]?$idArray[0]:$thisUid,'*','sorting','AND pages.doktype<199 AND pages.doktype!=6');
                                $pO = 0;
                                if ($mode==2 && count($pageArray))      {       // random
-                                       $this->make_seed();
                                        $randval = intval(rand(0,count($pageArray)-1));
                                        $pO = $randval;
                                }
@@ -4356,8 +4355,11 @@ if (version == "n3") {
         * Seeds the random number engine.
         *
         * @return      void
+        * @deprecated  since TYPO3 4.3 - the random number generator is seeded automatically since PHP 4.2.0
         */
        function make_seed() {
+               t3lib_div::logDeprecatedFunction();
+
                list($usec, $sec) = explode(' ', microtime());
                $seedV = (float)$sec + ((float)$usec * 100000);
                srand($seedV);