diff --git a/admin/exportclases/class.tcpdf.php b/admin/exportclases/class.tcpdf.php index 3b765d9d8..d084b8b78 100644 --- a/admin/exportclases/class.tcpdf.php +++ b/admin/exportclases/class.tcpdf.php @@ -67,7 +67,7 @@ // dullus for text Justification. // Bob Vincent (pillarsdotnet@users.sourceforge.net) for
  • value attribute. // Patrick Benny for text stretch suggestion on Cell(). -// Johannes Gntert for JavaScript support. +// Johannes G�ntert for JavaScript support. // Denis Van Nuffelen for Dynamic Form. // Jacek Czekaj for multibyte justification // Anthony Ferrara for the reintroduction of legacy image methods. @@ -78,7 +78,7 @@ // Mohamad Ali Golkar, Saleh AlMatrafe, Charles Abbott for Arabic and Persian support. // Moritz Wagner and Andreas Wurmser for graphic functions. // Andrew Whitehead for core fonts support. -// Esteban Jol Marn for OpenType font conversion. +// Esteban Jo�l Mar�n for OpenType font conversion. // Teus Hagen for several suggestions and fixes. // Yukihiro Nakadaira for CID-0 CJK fonts fixes. // Kosmas Papachristos for some CSS improvements. @@ -6947,7 +6947,7 @@ if (!class_exists('TCPDF', false)) { $protection += $options[$permission]; } if ($owner_pass === null) { - $owner_pass = uniqid(rand()); + $owner_pass = uniqid(random_int()); } $this->encrypted = true; $this->_generateencryptionkey($user_pass, $owner_pass, $protection); @@ -8784,7 +8784,7 @@ if (!class_exists('TCPDF', false)) { /* * Adds a javascript * @access public - * @author Johannes Gntert, Nicola Asuni + * @author Johannes G�ntert, Nicola Asuni * @since 2.1.002 (2008-02-12) */ public function IncludeJS($script) { @@ -8794,7 +8794,7 @@ if (!class_exists('TCPDF', false)) { /* * Create a javascript PDF string. * @access protected - * @author Johannes Gntert, Nicola Asuni + * @author Johannes G�ntert, Nicola Asuni * @since 2.1.002 (2008-02-12) */ protected function _putjavascript() { @@ -9424,7 +9424,7 @@ if (!class_exists('TCPDF', false)) { * @param array $col1 first color (RGB components). * @param array $col2 second color (RGB components). * @param array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0). - * @author Andreas Wrmser, Nicola Asuni + * @author Andreas W�rmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @access public */ @@ -9442,7 +9442,7 @@ if (!class_exists('TCPDF', false)) { * @param array $col1 first color (RGB components). * @param array $col2 second color (RGB components). * @param array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined. - * @author Andreas Wrmser, Nicola Asuni + * @author Andreas W�rmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @access public */ @@ -9464,7 +9464,7 @@ if (!class_exists('TCPDF', false)) { * @param array $coords * @param array $coords_min minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0 * @param array $coords_max maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1 - * @author Andreas Wrmser, Nicola Asuni + * @author Andreas W�rmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @access public */ @@ -9544,7 +9544,7 @@ if (!class_exists('TCPDF', false)) { * @param float $y ordinate of the top left corner of the rectangle. * @param float $w width of the rectangle. * @param float $h height of the rectangle. - * @author Andreas Wrmser, Nicola Asuni + * @author Andreas W�rmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @access protected */ @@ -9567,7 +9567,7 @@ if (!class_exists('TCPDF', false)) { * @param array $col1 first color (RGB components). * @param array $col2 second color (RGB components). * @param array $coords array of coordinates. - * @author Andreas Wrmser, Nicola Asuni + * @author Andreas W�rmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @access protected */ @@ -9591,7 +9591,7 @@ if (!class_exists('TCPDF', false)) { /** * Output shaders. - * @author Andreas Wrmser, Nicola Asuni + * @author Andreas W�rmser, Nicola Asuni * @since 3.1.000 (2008-06-09) * @access protected */ diff --git a/admin/survey/SurveyAdmin.php b/admin/survey/SurveyAdmin.php index 800858d92..49891a2d4 100644 --- a/admin/survey/SurveyAdmin.php +++ b/admin/survey/SurveyAdmin.php @@ -4946,7 +4946,7 @@ class SurveyAdmin #če naslov ni podan ali če je uporabnik pusti nespremenjen input box za ime ankete (==> Ime ankete) zgeneriramo novo ime if ($naslov == null || $naslov == $lang['srv_novaanketa_polnoime']) { - $naslov = 'Test ' . rand(100, 999); + $naslov = 'Test ' . random_int(100, 999); } if ($akronim == null || $akronim == $lang['srv_novaanketa_ime_respondenti']) { diff --git a/admin/survey/SurveyAdminSettings.php b/admin/survey/SurveyAdminSettings.php index e7aad7593..5a8cc17bf 100644 --- a/admin/survey/SurveyAdminSettings.php +++ b/admin/survey/SurveyAdminSettings.php @@ -7996,7 +7996,7 @@ class SurveyAdminSettings { // izberemo random hash, ki se ni v bazi (to more bit, ker je index na fieldu cookie) do { - $rand = md5(mt_rand(1, mt_getrandmax()).'@'.$_SERVER['REMOTE_ADDR']); + $rand = md5(random_int(1, mt_getrandmax()).'@'.$_SERVER['REMOTE_ADDR']); $sql1 = sisplet_query("SELECT id FROM srv_user WHERE cookie = '$rand'"); } while (mysqli_num_rows($sql1) > 0); @@ -8032,9 +8032,9 @@ class SurveyAdminSettings { // Ce imamo samo veljavne vedno oznacimo enega if($only_valid == 1) - $rand = rand(1, mysqli_num_rows($sql1)); + $rand = random_int(1, mysqli_num_rows($sql1)); else - $rand = rand(0, mysqli_num_rows($sql1)); + $rand = random_int(0, mysqli_num_rows($sql1)); if ($rand > 0) { for ($j=1; $j<=$rand; $j++) @@ -8065,11 +8065,11 @@ class SurveyAdminSettings { $randX = 0; if($only_valid == 1) - $randX = rand(1, mysqli_num_rows($sql1)); + $randX = random_int(1, mysqli_num_rows($sql1)); $j=1; while ($row1 = mysqli_fetch_array($sql1)) { - $rand = rand(-1, 1); + $rand = random_int(-1, 1); if ($rand > 0){ $vrednost[$row1['id']] = $row1['id']; @@ -8109,9 +8109,9 @@ class SurveyAdminSettings { // Ce imamo samo veljavne vedno oznacimo enega if($only_valid == 1) - $rand = rand(1, mysqli_num_rows($sql2)); + $rand = random_int(1, mysqli_num_rows($sql2)); else - $rand = rand(0, mysqli_num_rows($sql2)); + $rand = random_int(0, mysqli_num_rows($sql2)); if ($rand > 0) { for ($j=1; $j<=$rand; $j++) @@ -8143,13 +8143,13 @@ class SurveyAdminSettings { $randX = 0; if($only_valid == 1) - $randX = rand(1, mysqli_num_rows($sql2)); + $randX = random_int(1, mysqli_num_rows($sql2)); $j=1; while ($row2 = mysqli_fetch_array($sql2)) { if ($s->checkSpremenljivka($row['id'], $isTestData=true)) { - $rand = rand(-1, 1); + $rand = random_int(-1, 1); if ($rand > 0) { $grid_id = $row2['id']; @@ -8193,7 +8193,7 @@ class SurveyAdminSettings { if($only_valid == 1) $value = $this->randomString(); else - $value = rand(0,1)==0 ? $this->randomString() : ''; + $value = random_int(0,1)==0 ? $this->randomString() : ''; $grid_id = $row2['id']; @@ -8226,7 +8226,7 @@ class SurveyAdminSettings { if($only_valid == 1) $vrednost = $this->randomString(); else - $vrednost = rand(0,1)==0 ? $this->randomString() : ''; + $vrednost = random_int(0,1)==0 ? $this->randomString() : ''; $srv_data_map .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '', '', '', '". ($vrednost != '' ? $vrednost : '-1')."', ''),"; @@ -8240,17 +8240,17 @@ class SurveyAdminSettings { else{ if ($s->checkSpremenljivka($row['id'], $isTestData=true)) { - $make_input = ($only_valid == 1 ? true : rand(0,1)==0); + $make_input = ($only_valid == 1 ? true : random_int(0,1)==0); if($make_input){ - $lat = floatval(mt_rand(454000, 466500)/10000); - $lng = floatval(mt_rand(136000, 163900)/10000); + $lat = floatval(random_int(454000, 466500)/10000); + $lng = floatval(random_int(136000, 163900)/10000); // Ce imamo samo veljavne imamo vedno vrednost if($only_valid == 1) $vrednost = $this->randomString(); else - $vrednost = rand(0,1)==0 ? $this->randomString() : ''; + $vrednost = random_int(0,1)==0 ? $this->randomString() : ''; $srv_data_map .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '$lat', '$lng', '[N/A]', '". ($vrednost != '' ? $vrednost : '-1')."', ''),"; @@ -8274,7 +8274,7 @@ class SurveyAdminSettings { if($only_valid == 1) $vrednost = $this->randomString(); else - $vrednost = rand(0,1)==0 ? $this->randomString() : ''; + $vrednost = random_int(0,1)==0 ? $this->randomString() : ''; $srv_data_heatmap .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '', '', '', '". ($vrednost != '' ? $vrednost : '-1')."', ''),"; @@ -8288,17 +8288,17 @@ class SurveyAdminSettings { else{ if ($s->checkSpremenljivka($row['id'], $isTestData=true)) { - $make_input = ($only_valid == 1 ? true : rand(0,1)==0); + $make_input = ($only_valid == 1 ? true : random_int(0,1)==0); if($make_input){ - $lat = floatval(mt_rand(454000, 466500)/10000); - $lng = floatval(mt_rand(136000, 163900)/10000); + $lat = floatval(random_int(454000, 466500)/10000); + $lng = floatval(random_int(136000, 163900)/10000); // Ce imamo samo veljavne imamo vedno vrednost if($only_valid == 1) $vrednost = $this->randomString(); else - $vrednost = rand(0,1)==0 ? $this->randomString() : ''; + $vrednost = random_int(0,1)==0 ? $this->randomString() : ''; $srv_data_heatmap .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '$lat', '$lng', '[N/A]', '". ($vrednost != '' ? $vrednost : '-1')."', ''),"; @@ -8325,7 +8325,7 @@ class SurveyAdminSettings { if($only_valid == 1) $value = $this->randomNumber(); else - $value = rand(0,1)==0 ? $this->randomNumber() : ''; + $value = random_int(0,1)==0 ? $this->randomNumber() : ''; $grid_id = $row2['id']; @@ -8349,7 +8349,7 @@ class SurveyAdminSettings { elseif ($row['tip'] == 4) { if ($s->checkSpremenljivka($row['id'], $isTestData=true)) { - $vrednost = rand(0,1)==0 ? $this->randomString() : ''; + $vrednost = random_int(0,1)==0 ? $this->randomString() : ''; if ($vrednost != '') $srv_data_text .= "('$row[id]', '', '$vrednost', '', '$this->usr_id'),"; } else { @@ -8369,7 +8369,7 @@ class SurveyAdminSettings { if($only_valid == 1) $vrednost = $this->randomString(); else - $vrednost = rand(0,1)==0 ? $this->randomString() : ''; + $vrednost = random_int(0,1)==0 ? $this->randomString() : ''; if ($vrednost != '') $srv_data_text .= "('$row[id]', '$row1[id]', '$vrednost', '', '$this->usr_id'),"; @@ -8407,7 +8407,7 @@ class SurveyAdminSettings { //if ($row['size'] >= 2) $vrednost[1] = $this->randomNumber(); if ($row['size'] >= 2) $vrednost[1] = $this->randomNumber($newLength); } - elseif (rand(0,1) == 0) { + elseif (random_int(0,1) == 0) { //if ($row['size'] >= 1) $vrednost[0] = $this->randomNumber(); if ($row['size'] >= 1) $vrednost[0] = $this->randomNumber($newLength); //if ($row['size'] >= 2) $vrednost[1] = $this->randomNumber(); @@ -8462,7 +8462,7 @@ class SurveyAdminSettings { if($only_valid == 1) $vrednost = $this->randomDate(); else - $vrednost = rand(0,1)==0 ? $this->randomDate() : ''; + $vrednost = random_int(0,1)==0 ? $this->randomDate() : ''; if ($vrednost != '') $srv_data_text .= "('$row[id]', '', '$vrednost', '', '$this->usr_id'),"; @@ -8487,12 +8487,12 @@ class SurveyAdminSettings { // Ce imamo samo veljavne imamo vedno vrednosti if($only_valid == 1){ - if (rand(0,1) == 0) $rows = floor($rows/2); + if (random_int(0,1) == 0) $rows = floor($rows/2); $array = range(1, $rows); shuffle($array); } - elseif (rand(0,1) == 0) { - if (rand(0,1) == 0) $rows = floor($rows/2); + elseif (random_int(0,1) == 0) { + if (random_int(0,1) == 0) $rows = floor($rows/2); $array = range(1, $rows); shuffle($array); } @@ -8533,7 +8533,7 @@ class SurveyAdminSettings { // Ce imamo samo veljavne imamo vedno vrednosti if($only_valid == 1) $vrednost = $this->randomNumber(); - elseif(rand(0,1) == 0) + elseif(random_int(0,1) == 0) $vrednost = $this->randomNumber(); if (isset( $vrednost )) { @@ -8566,9 +8566,9 @@ class SurveyAdminSettings { // Ce imamo samo veljavne vedno oznacimo enega if($only_valid == 1) - $rand = rand(1, mysqli_num_rows($sql2)); + $rand = random_int(1, mysqli_num_rows($sql2)); else - $rand = rand(0, mysqli_num_rows($sql2)); + $rand = random_int(0, mysqli_num_rows($sql2)); if ($rand > 0) { for ($j=1; $j<=$rand; $j++) @@ -8600,13 +8600,13 @@ class SurveyAdminSettings { $randX = 0; if($only_valid == 1) - $randX = rand(1, mysqli_num_rows($sql2)); + $randX = random_int(1, mysqli_num_rows($sql2)); $j=1; while ($row2 = mysqli_fetch_array($sql2)) { if ($s->checkSpremenljivka($rowC['id'], $isTestData=true)) { - $rand = rand(-1, 1); + $rand = random_int(-1, 1); if ($rand > 0) { $grid_id = $row2['id']; @@ -8651,7 +8651,7 @@ class SurveyAdminSettings { if($only_valid == 1) $value = $this->randomString(); else - $value = rand(0,1)==0 ? $this->randomString() : ''; + $value = random_int(0,1)==0 ? $this->randomString() : ''; $grid_id = $row2['id']; @@ -8686,7 +8686,7 @@ class SurveyAdminSettings { if($only_valid == 1) $value = $this->randomNumber(); else - $value = rand(0,1)==0 ? $this->randomNumber() : ''; + $value = random_int(0,1)==0 ? $this->randomNumber() : ''; $grid_id = $row2['id']; @@ -8939,13 +8939,13 @@ class SurveyAdminSettings { $chars_length = (strlen($chars) - 1); // Start our string - $string = $chars[mt_rand(0, $chars_length)]; + $string = $chars[random_int(0, $chars_length)]; // Generate random string for ($i = 1; $i < $length; $i = strlen($string)) { // Grab a random character from our list - $r = $chars[mt_rand(0, $chars_length)]; + $r = $chars[random_int(0, $chars_length)]; // Make sure the same two characters don't appear next to each other if ($r != $string[$i - 1]) $string .= $r; @@ -8962,7 +8962,7 @@ class SurveyAdminSettings { function randomDate ($startDate = '01.01.1950', $endDate = '') { if ($endDate == '') $endDate = date("d.m.Y"); $days = round((strtotime($endDate) - strtotime($startDate)) / (60 * 60 * 24)); - $n = rand(0,$days); + $n = random_int(0,$days); return date("d.m.Y",strtotime("$startDate + $n days")); } diff --git a/admin/survey/classes/class.SurveyCopy.php b/admin/survey/classes/class.SurveyCopy.php index 34d1a7c1b..2a2d23c55 100644 --- a/admin/survey/classes/class.SurveyCopy.php +++ b/admin/survey/classes/class.SurveyCopy.php @@ -845,7 +845,7 @@ class SurveyCopy { foreach ( $arr_src['srv_user'] AS $row_array ) { do { - $rand = md5(mt_rand(1, mt_getrandmax()).'@'.$ip); + $rand = md5(random_int(1, PHP_INT_MAX).'@'.$ip); $sql = sisplet_query("SELECT id FROM srv_user WHERE cookie = '$rand'"); } while (mysqli_num_rows($sql) > 0); @@ -1175,7 +1175,7 @@ class SurveyCopy { // Nastavimo nov cookie - izberemo random hash, ki se ni v bazi do { - $rand = md5(mt_rand(1, mt_getrandmax()) . '@' . $global_user_id); + $rand = md5(random_int(1, PHP_INT_MAX) . '@' . $global_user_id); $sql = sisplet_query("SELECT id FROM srv_user WHERE cookie = '$rand'"); diff --git a/admin/survey/classes/class.SurveyMobile.php b/admin/survey/classes/class.SurveyMobile.php index 7135fa2d2..0c3c237e5 100644 --- a/admin/survey/classes/class.SurveyMobile.php +++ b/admin/survey/classes/class.SurveyMobile.php @@ -71,7 +71,7 @@ class SurveyMobile { // Ni se registriran, ga je potrebno dodati na prijavno formo else { // geslo med 00000 in zzzzz - $pass = base_convert(mt_rand(0x19A100, 0x39AA3FF), 10, 36); + $pass = base_convert(random_int(0x19A100, 0x39AA3FF), 10, 36); $EncPass = base64_encode((hash('SHA256', $pass))); $fn = explode("@", $user_email); diff --git a/admin/survey/classes/class.SurveyRespondents.php b/admin/survey/classes/class.SurveyRespondents.php index 235edc61c..b6c364f40 100644 --- a/admin/survey/classes/class.SurveyRespondents.php +++ b/admin/survey/classes/class.SurveyRespondents.php @@ -726,7 +726,7 @@ class SurveyRespondents { // izberemo random hash, ki se ni v bazi do { - $rand = md5(mt_rand(1, mt_getrandmax()) . '@' . $_SERVER['REMOTE_ADDR']); + $rand = md5(random_int(1, PHP_INT_MAX) . '@' . $_SERVER['REMOTE_ADDR']); $sql = sisplet_query("SELECT id FROM srv_user WHERE SUBSTRING(cookie, 1, 6) = SUBSTRING('".$rand."', 1, 6)"); } while (mysqli_num_rows($sql) > 0); diff --git a/admin/survey/classes/class.SurveyTelephone.php b/admin/survey/classes/class.SurveyTelephone.php index 6330d2a5f..c01e22294 100644 --- a/admin/survey/classes/class.SurveyTelephone.php +++ b/admin/survey/classes/class.SurveyTelephone.php @@ -2770,7 +2770,7 @@ class SurveyTelephone { } function generateCode() { - $cookie = md5(mt_rand(1, mt_getrandmax()) . '@' . $_SERVER['REMOTE_ADDR']); + $cookie = md5(random_int(1, PHP_INT_MAX) . '@' . $_SERVER['REMOTE_ADDR']); return array(substr($cookie,0,6), $cookie); } diff --git a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php index c053f57c2..c7ece5116 100644 --- a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php +++ b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php @@ -1383,7 +1383,7 @@ class SurveyInvitationsNew { function generateCode() { // Zgeneriramo cookie - $cookie = md5(mt_rand(1, mt_getrandmax()) . '@' . $_SERVER['REMOTE_ADDR']); + $cookie = md5(random_int(1, PHP_INT_MAX) . '@' . $_SERVER['REMOTE_ADDR']); // Ce je prvi znak stevilka jo spremenimo v crko ker drugace vcasih izvoz v excel ne dela ok $letters = array('a', 'b', 'c', 'd', 'e', 'f'); diff --git a/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php b/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php index 031a88854..e199b2372 100644 --- a/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php +++ b/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php @@ -112,7 +112,7 @@ class SurveyUnsubscribe { } function generateCode() { - $cookie = md5(mt_rand(1, mt_getrandmax()) . '@' . $_SERVER['REMOTE_ADDR']); + $cookie = md5(random_int(1, PHP_INT_MAX) . '@' . $_SERVER['REMOTE_ADDR']); return array(substr($cookie,0,6), $cookie); } diff --git a/admin/survey/excel/PHPExcel/CachedObjectStorage/CacheBase.php b/admin/survey/excel/PHPExcel/CachedObjectStorage/CacheBase.php index d2eea08bb..6e0043c70 100644 --- a/admin/survey/excel/PHPExcel/CachedObjectStorage/CacheBase.php +++ b/admin/survey/excel/PHPExcel/CachedObjectStorage/CacheBase.php @@ -220,7 +220,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase { if (function_exists('posix_getpid')) { $baseUnique = posix_getpid(); } else { - $baseUnique = mt_rand(); + $baseUnique = random_int(); } return uniqid($baseUnique,true); } diff --git a/admin/survey/excel/PHPExcel/Calculation/MathTrig.php b/admin/survey/excel/PHPExcel/Calculation/MathTrig.php index 79c573b27..a1e7fc3b1 100644 --- a/admin/survey/excel/PHPExcel/Calculation/MathTrig.php +++ b/admin/survey/excel/PHPExcel/Calculation/MathTrig.php @@ -79,7 +79,7 @@ class PHPExcel_Calculation_MathTrig { * ATAN2 * * This function calculates the arc tangent of the two variables x and y. It is similar to - * calculating the arc tangent of y x, except that the signs of both arguments are used + * calculating the arc tangent of y � x, except that the signs of both arguments are used * to determine the quadrant of the result. * The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a * point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between @@ -880,9 +880,9 @@ class PHPExcel_Calculation_MathTrig { $max = PHPExcel_Calculation_Functions::flattenSingleValue($max); if ($min == 0 && $max == 0) { - return (rand(0,10000000)) / 10000000; + return (random_int(0,10000000)) / 10000000; } else { - return rand($min, $max); + return random_int($min, $max); } } // function RAND() diff --git a/admin/survey/minify/vendor/monolog/monolog/tests/Monolog/Handler/PHPConsoleHandlerTest.php b/admin/survey/minify/vendor/monolog/monolog/tests/Monolog/Handler/PHPConsoleHandlerTest.php index 152573ef0..c8777bae4 100644 --- a/admin/survey/minify/vendor/monolog/monolog/tests/Monolog/Handler/PHPConsoleHandlerTest.php +++ b/admin/survey/minify/vendor/monolog/monolog/tests/Monolog/Handler/PHPConsoleHandlerTest.php @@ -128,7 +128,7 @@ class PHPConsoleHandlerTest extends TestCase { $message = 'test'; $tag = 'tag'; - $context = array($tag, 'custom' => mt_rand()); + $context = array($tag, 'custom' => random_int()); $expectedMessage = $message . ' ' . json_encode(array_slice($context, 1)); $this->debugDispatcher->expects($this->once())->method('dispatchDebug')->with( $this->equalTo($expectedMessage), @@ -139,7 +139,7 @@ class PHPConsoleHandlerTest extends TestCase public function testDebugTags($tagsContextKeys = null) { - $expectedTags = mt_rand(); + $expectedTags = random_int(); $logger = $this->initLogger($tagsContextKeys ? array('debugTagsKeysInContext' => $tagsContextKeys) : array()); if (!$tagsContextKeys) { $tagsContextKeys = $this->getHandlerDefaultOption('debugTagsKeysInContext'); diff --git a/admin/survey/minify/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php b/admin/survey/minify/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php index 487030fe3..797cff81f 100644 --- a/admin/survey/minify/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php +++ b/admin/survey/minify/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php @@ -128,7 +128,7 @@ class StreamHandlerTest extends TestCase */ public function testWriteNonExistingResource() { - $handler = new StreamHandler('ftp://foo/bar/baz/'.rand(0, 10000)); + $handler = new StreamHandler('ftp://foo/bar/baz/'.random_int(0, 10000)); $handler->handle($this->getRecord()); } @@ -138,7 +138,7 @@ class StreamHandlerTest extends TestCase */ public function testWriteNonExistingPath() { - $handler = new StreamHandler(sys_get_temp_dir().'/bar/'.rand(0, 10000).DIRECTORY_SEPARATOR.rand(0, 10000)); + $handler = new StreamHandler(sys_get_temp_dir().'/bar/'.random_int(0, 10000).DIRECTORY_SEPARATOR.random_int(0, 10000)); $handler->handle($this->getRecord()); } @@ -148,7 +148,7 @@ class StreamHandlerTest extends TestCase */ public function testWriteNonExistingFileResource() { - $handler = new StreamHandler('file://'.sys_get_temp_dir().'/bar/'.rand(0, 10000).DIRECTORY_SEPARATOR.rand(0, 10000)); + $handler = new StreamHandler('file://'.sys_get_temp_dir().'/bar/'.random_int(0, 10000).DIRECTORY_SEPARATOR.random_int(0, 10000)); $handler->handle($this->getRecord()); } @@ -163,7 +163,7 @@ class StreamHandlerTest extends TestCase if (defined('PHP_WINDOWS_VERSION_BUILD')) { $this->markTestSkipped('Permissions checks can not run on windows'); } - $handler = new StreamHandler('/foo/bar/'.rand(0, 10000).DIRECTORY_SEPARATOR.rand(0, 10000)); + $handler = new StreamHandler('/foo/bar/'.random_int(0, 10000).DIRECTORY_SEPARATOR.random_int(0, 10000)); $handler->handle($this->getRecord()); } @@ -178,7 +178,7 @@ class StreamHandlerTest extends TestCase if (defined('PHP_WINDOWS_VERSION_BUILD')) { $this->markTestSkipped('Permissions checks can not run on windows'); } - $handler = new StreamHandler('file:///foo/bar/'.rand(0, 10000).DIRECTORY_SEPARATOR.rand(0, 10000)); + $handler = new StreamHandler('file:///foo/bar/'.random_int(0, 10000).DIRECTORY_SEPARATOR.random_int(0, 10000)); $handler->handle($this->getRecord()); } } diff --git a/admin/survey/minify/vendor/mrclay/props-dic/scripts/example-pimple.php b/admin/survey/minify/vendor/mrclay/props-dic/scripts/example-pimple.php index d5efe5007..7bdb03a31 100644 --- a/admin/survey/minify/vendor/mrclay/props-dic/scripts/example-pimple.php +++ b/admin/survey/minify/vendor/mrclay/props-dic/scripts/example-pimple.php @@ -43,7 +43,7 @@ namespace PropsExample { return new Session($c->session_storage); }); - $this->random = $this->protect(function () { return rand(); }); + $this->random = $this->protect(function () { return random_int(); }); $this->mail = function (MyContainer2 $c) { return new Zend_Mail(); diff --git a/admin/survey/modules/mod_MAZA/class.MAZA.php b/admin/survey/modules/mod_MAZA/class.MAZA.php index aefae5279..16f701868 100644 --- a/admin/survey/modules/mod_MAZA/class.MAZA.php +++ b/admin/survey/modules/mod_MAZA/class.MAZA.php @@ -1447,7 +1447,7 @@ class MAZA { $max = /*strlen($codeAlphabet)-1;*/59; // edited for ($i = 0; $i < $length; $i++) { - $token .= $codeAlphabet[mt_rand(0, $max)]; + $token .= $codeAlphabet[random_int(0, $max)]; } return $token; diff --git a/frontend/api/class.ApiLogin.php b/frontend/api/class.ApiLogin.php index 5e12abc84..9d96ea3c9 100644 --- a/frontend/api/class.ApiLogin.php +++ b/frontend/api/class.ApiLogin.php @@ -815,7 +815,7 @@ class ApiLogin } // Ni se registriran, ga je potrebno dodati na prijavno formo else { // geslo med 00000 in zzzzz - $this->pass = base_convert(mt_rand(0x19A100, 0x39AA3FF), 10, 36); + $this->pass = base_convert(random_int(0x19A100, 0x39AA3FF), 10, 36); $this->EncPass = base64_encode((hash('SHA256', $this->pass.$pass_salt))); $this->email = $user_email; @@ -977,7 +977,7 @@ class ApiLogin } // geslo med 00000 in zzzzz - $this->pass = base_convert(mt_rand(0x19A100, 0x39AA3FF), 10, 36); + $this->pass = base_convert(random_int(0x19A100, 0x39AA3FF), 10, 36); $this->EncPass = base64_encode((hash('SHA256', $this->pass.$pass_salt))); $this->email = str_replace([" ", "č", "ć", "Č", "Ć", "ž", "Ž", "š", "Š", "đ", "Đ"], [".", "c", "c", "C", "C", "z", "Z", "s", "S", "d", "D"], $user->email); @@ -1933,7 +1933,7 @@ class ApiLogin // Novo geslo sestavis iz dveh nakljucnih besed + stevilke include($site_path.'lang/words_'.$lang['language_short'].'.php'); - $geslo = strtolower($words[rand(0, 999)].rand(0, 9).$words[rand(0, 999)]); + $geslo = strtolower($words[random_int(0, 999)].random_int(0, 9).$words[random_int(0, 999)]); // passhint je parameter v linku ki ga skombiniras skupaj z emailom in mu potem aktiviras novo geslo $passhint = base64_encode((hash('SHA256', time().$pass_salt))); diff --git a/frontend/payments/cebelica/InvoiceFox/lib/pulp/Format.php b/frontend/payments/cebelica/InvoiceFox/lib/pulp/Format.php index cbc46cb00..e02260857 100644 --- a/frontend/payments/cebelica/InvoiceFox/lib/pulp/Format.php +++ b/frontend/payments/cebelica/InvoiceFox/lib/pulp/Format.php @@ -119,7 +119,7 @@ class Format { $vid = ''; General::srand_once(); for ($i=0; $i<$len; $i++) - $vid .= rand(0,9); + $vid .= random_int(0,9); return $vid; } diff --git a/function/ProfileClass.php b/function/ProfileClass.php index 273f2a768..cff5f8f4b 100644 --- a/function/ProfileClass.php +++ b/function/ProfileClass.php @@ -308,7 +308,7 @@ class Profile { // Ni se registriran, ga je potrebno dodati na prijavno formo else { // geslo med 00000 in zzzzz - $this->pass = base_convert(mt_rand(0x19A100, 0x39AA3FF), 10, 36); + $this->pass = base_convert(random_int(0x19A100, 0x39AA3FF), 10, 36); $this->EncPass = base64_encode((hash('SHA256', $this->pass .$pass_salt))); $this->email = $user_email; $fn = explode ("@", $user_email); diff --git a/main/survey/app/Controllers/HeaderController.php b/main/survey/app/Controllers/HeaderController.php index 69c595641..479f491fa 100644 --- a/main/survey/app/Controllers/HeaderController.php +++ b/main/survey/app/Controllers/HeaderController.php @@ -438,9 +438,9 @@ class HeaderController extends Controller // moznost zip skinov if (!is_file(self::$site_path . 'main/survey/skins/' . $row['skin'] . '.css')) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } } // nastavljen je profil, nastavimo temo in potem še lastne nastavitve @@ -451,9 +451,9 @@ class HeaderController extends Controller // moznost zip skinov if (!is_file(self::$site_path . 'main/survey/skins/' . $rowa['skin'] . '.css')) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } $sqlt = sisplet_query("SELECT * FROM srv_theme_editor WHERE profile_id = '" . $row['skin_profile'] . "'"); @@ -602,7 +602,7 @@ class HeaderController extends Controller // Za office in nature skina imamo random background if($row['skin'] == '1kaOffice' || $row['skin'] == '1kaNature'){ - $bg_number = rand(1,15); + $bg_number = random_int(1,15); echo ''; } } @@ -634,10 +634,10 @@ class HeaderController extends Controller if ($row['skin_profile_mobile'] == 0) { if (!is_file(self::$site_path . 'main/survey/skins/' . $row['mobile_skin'] . '.css')) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } } // nastavljen je profil, nastavimo temo in potem še lastne nastavitve @@ -647,9 +647,9 @@ class HeaderController extends Controller $rowa = mysqli_fetch_array($sqla); if (!is_file(self::$site_path . 'main/survey/skins/' . $rowa['skin'] . '.css')) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } $sqlt = sisplet_query("SELECT * FROM srv_theme_editor_mobile WHERE profile_id = '" . $row['skin_profile_mobile'] . "'"); @@ -814,14 +814,14 @@ class HeaderController extends Controller echo ''; // Imamo različne backgrounde - $bg_number = rand(1,9); + $bg_number = random_int(1,9); echo ''; - echo ' ' . "\n"; + echo ' ' . "\n"; // Premaknemo footer na dno echo '