aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche')
-rwxr-xr-xinc/poche/Poche.class.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index c7aa71e8..a8cd5871 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -1122,7 +1122,13 @@ class Poche
1122 public function generateToken() 1122 public function generateToken()
1123 { 1123 {
1124 if (ini_get('open_basedir') === '') { 1124 if (ini_get('open_basedir') === '') {
1125 $token = substr(base64_encode(file_get_contents('/dev/urandom', false, null, 0, 20)), 0, 15); 1125 if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
1126 echo 'This is a server using Windows!';
1127 // alternative to /dev/urandom for Windows
1128 $token = substr(base64_encode(uniqid(mt_rand(), true)), 0, 20);
1129 } else {
1130 $token = substr(base64_encode(file_get_contents('/dev/urandom', false, null, 0, 20)), 0, 15);
1131 }
1126 } 1132 }
1127 else { 1133 else {
1128 $token = substr(base64_encode(uniqid(mt_rand(), true)), 0, 20); 1134 $token = substr(base64_encode(uniqid(mt_rand(), true)), 0, 20);