Passed
Push — master ( 57b662...6ceae8 )
by Vitalii
16:37 queued 07:18
created
html/inc/random_compat/random_bytes_libsodium_legacy.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,10 +70,10 @@
 block discarded – undo
70 70
                 $n = ($bytes - $i) > 1073741824
71 71
                     ? 1073741824
72 72
                     : $bytes - $i;
73
-                $buf .= Sodium::randombytes_buf((int) $n);
73
+                $buf .= Sodium::randombytes_buf((int)$n);
74 74
             }
75 75
         } else {
76
-            $buf .= Sodium::randombytes_buf((int) $bytes);
76
+            $buf .= Sodium::randombytes_buf((int)$bytes);
77 77
         }
78 78
 
79 79
         if (is_string($buf)) {
Please login to merge, or discard this patch.
html/inc/random_compat/random_int.inc 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         }
79 79
 
80 80
         if ($max === $min) {
81
-            return (int) $min;
81
+            return (int)$min;
82 82
         }
83 83
 
84 84
         /**
@@ -124,12 +124,12 @@  discard block
 block discarded – undo
124 124
              * type juggling
125 125
              */
126 126
             while ($range > 0) {
127
-                if ($bits % 8 === 0) {
127
+                if ($bits%8 === 0) {
128 128
                     ++$bytes;
129 129
                 }
130 130
                 ++$bits;
131 131
                 $range >>= 1;
132
-                $mask = $mask << 1 | 1;
132
+                $mask = $mask << 1|1;
133 133
             }
134 134
             $valueShift = $min;
135 135
         }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
              */
168 168
             $val &= 0;
169 169
             for ($i = 0; $i < $bytes; ++$i) {
170
-                $val |= ord($randomByteString[$i]) << ($i * 8);
170
+                $val |= ord($randomByteString[$i]) << ($i*8);
171 171
             }
172 172
 
173 173
             /**
@@ -185,6 +185,6 @@  discard block
 block discarded – undo
185 185
              */
186 186
         } while (!is_int($val) || $val > $max || $val < $min);
187 187
 
188
-        return (int) $val;
188
+        return (int)$val;
189 189
     }
190 190
 }
Please login to merge, or discard this patch.
html/inc/random_compat/cast_to_int.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@
 block discarded – undo
60 60
             &&
61 61
             $number < PHP_INT_MAX
62 62
         ) {
63
-            $number = (int) $number;
63
+            $number = (int)$number;
64 64
         }
65 65
 
66 66
         if (is_int($number)) {
67
-            return (int) $number;
67
+            return (int)$number;
68 68
         } elseif (!$fail_open) {
69 69
             throw new TypeError(
70 70
                 'Expected an integer.'
Please login to merge, or discard this patch.
html/inc/random_compat/random.inc 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
     $RandomCompatversion = array_map('intval', explode('.', PHP_VERSION));
35 35
     define(
36 36
         'PHP_VERSION_ID',
37
-        $RandomCompatversion[0] * 10000
38
-        + $RandomCompatversion[1] * 100
37
+        $RandomCompatversion[0]*10000
38
+        + $RandomCompatversion[1]*100
39 39
         + $RandomCompatversion[2]
40 40
     );
41 41
     $RandomCompatversion = null;
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 
55 55
 $RandomCompatDIR = dirname(__FILE__);
56 56
 
57
-require_once $RandomCompatDIR . '/byte_safe_strings.inc';
58
-require_once $RandomCompatDIR . '/cast_to_int.inc';
59
-require_once $RandomCompatDIR . '/error_polyfill.inc';
57
+require_once $RandomCompatDIR.'/byte_safe_strings.inc';
58
+require_once $RandomCompatDIR.'/cast_to_int.inc';
59
+require_once $RandomCompatDIR.'/error_polyfill.inc';
60 60
 
61 61
 if (!is_callable('random_bytes')) {
62 62
     /**
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
     if (extension_loaded('libsodium')) {
77 77
         // See random_bytes_libsodium.php
78 78
         if (PHP_VERSION_ID >= 50300 && is_callable('\\Sodium\\randombytes_buf')) {
79
-            require_once $RandomCompatDIR . '/random_bytes_libsodium.inc';
79
+            require_once $RandomCompatDIR.'/random_bytes_libsodium.inc';
80 80
         } elseif (method_exists('Sodium', 'randombytes_buf')) {
81
-            require_once $RandomCompatDIR . '/random_bytes_libsodium_legacy.inc';
81
+            require_once $RandomCompatDIR.'/random_bytes_libsodium_legacy.inc';
82 82
         }
83 83
     }
84 84
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             // place, that is not helpful to us here.
118 118
 
119 119
             // See random_bytes_dev_urandom.php
120
-            require_once $RandomCompatDIR . '/random_bytes_dev_urandom.inc';
120
+            require_once $RandomCompatDIR.'/random_bytes_dev_urandom.inc';
121 121
         }
122 122
         // Unset variables after use
123 123
         $RandomCompat_basedir = null;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         extension_loaded('mcrypt')
160 160
     ) {
161 161
         // See random_bytes_mcrypt.php
162
-        require_once $RandomCompatDIR . '/random_bytes_mcrypt.inc';
162
+        require_once $RandomCompatDIR.'/random_bytes_mcrypt.inc';
163 163
     }
164 164
     $RandomCompatUrandom = null;
165 165
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1');
185 185
                 if (method_exists($RandomCompatCOMtest, 'GetRandom')) {
186 186
                     // See random_bytes_com_dotnet.php
187
-                    require_once $RandomCompatDIR . '/random_bytes_com_dotnet.inc';
187
+                    require_once $RandomCompatDIR.'/random_bytes_com_dotnet.inc';
188 188
                 }
189 189
             } catch (com_exception $e) {
190 190
                 // Don't try to use it.
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 }
220 220
 
221 221
 if (!is_callable('random_int')) {
222
-    require_once $RandomCompatDIR . '/random_int.inc';
222
+    require_once $RandomCompatDIR.'/random_int.inc';
223 223
 }
224 224
 
225 225
 $RandomCompatDIR = null;
Please login to merge, or discard this patch.
html/inc/token.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     $expiration = $now + $duration;
32 32
     $type = BoincDb::escape_string($type);
33 33
     $ret = BoincToken::insert("(token,userid,type,create_time,expire_time) values ('$token', $userid, '$type', $now, $expiration)");
34
-    if ( !$ret ) {
34
+    if (!$ret) {
35 35
         return null;
36 36
     }
37 37
     return $token;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
 function is_valid_token($userid, $token, $type) {
41 41
     $boincToken = BoincToken::lookup_valid_token($userid, $token, $type);
42
-    if ( $boincToken == null ) {
42
+    if ($boincToken == null) {
43 43
         return false;
44 44
     }
45 45
     return true;
Please login to merge, or discard this patch.
html/ops/result_summary.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,5 +26,5 @@
 block discarded – undo
26 26
 admin_show_result_summary();
27 27
 
28 28
 admin_page_tail();
29
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
29
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
30 30
 ?>
Please login to merge, or discard this patch.
html/user/edit_email_action.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
             echo tra("Invalid password.");
63 63
         } else {
64 64
             $passwd_hash = md5($passwd.$email_addr);
65
-            $database_passwd_hash = password_hash($passwd_hash , PASSWORD_DEFAULT);
65
+            $database_passwd_hash = password_hash($passwd_hash, PASSWORD_DEFAULT);
66 66
             $email_addr = BoincDb::escape_string($email_addr);
67 67
             $user->email_addr_change_time = time();
68 68
             $result = $user->update(
Please login to merge, or discard this patch.
html/user/recover_email.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         } else {
51 51
             echo tra("Email address has been reverted.")."<br /><br />".tra("You need to reset your password:  ")."<a href=\"".secure_url_base()."get_passwd.php\">".secure_url_base()."get_passwd.php</a>";
52 52
 
53
-            $database_passwd_hash = password_hash(random_string() , PASSWORD_DEFAULT);
53
+            $database_passwd_hash = password_hash(random_string(), PASSWORD_DEFAULT);
54 54
             //Change previous_email
55 55
             $result = $tmpuser->update(
56 56
                 "email_addr=previous_email_addr, previous_email_addr='', email_addr_change_time=0, passwd_hash='$database_passwd_hash', email_validated=0"
Please login to merge, or discard this patch.
html/ops/test_token.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,39 +11,39 @@
 block discarded – undo
11 11
 BoincToken::insert("(token,userid,type,create_time, expire_time) values ('$token', 0, 'T', $now, $now+3600)");
12 12
 
13 13
 $boincTokens = BoincToken::enum("userid=0");
14
-foreach($boincTokens as $boincToken) {
15
-    echo $boincToken->token . "\n";
16
-    echo $boincToken->userid . "\n";
17
-    echo $boincToken->type . "\n";
18
-    echo $boincToken->create_time . "\n";
19
-    echo $boincToken->expire_time . "\n";
14
+foreach ($boincTokens as $boincToken) {
15
+    echo $boincToken->token."\n";
16
+    echo $boincToken->userid."\n";
17
+    echo $boincToken->type."\n";
18
+    echo $boincToken->create_time."\n";
19
+    echo $boincToken->expire_time."\n";
20 20
 }
21 21
 
22 22
 echo "---------------\n";
23 23
 $boincToken = BoincToken::lookup("userid=0");
24
-echo $boincToken->token . "\n";
25
-echo $boincToken->userid . "\n";
26
-echo $boincToken->type . "\n";
27
-echo $boincToken->create_time . "\n";
28
-echo $boincToken->expire_time . "\n";
24
+echo $boincToken->token."\n";
25
+echo $boincToken->userid."\n";
26
+echo $boincToken->type."\n";
27
+echo $boincToken->create_time."\n";
28
+echo $boincToken->expire_time."\n";
29 29
 
30 30
 echo "---------------\n";
31 31
 $boincToken = BoincToken::lookup_valid_token(0, $token, 'T');
32
-if ( $boincToken != null ) {
32
+if ($boincToken != null) {
33 33
     echo "Found valid token\n";
34 34
 }
35 35
 
36 36
 echo "---------------\n";
37 37
 $boincToken = BoincToken::lookup_valid_token(0, 'notrealtoken', 'T');
38
-if ( $boincToken == null ) {
38
+if ($boincToken == null) {
39 39
     echo "Successfully didn't find invalid token\n";
40 40
 }
41 41
 
42 42
 echo "---------------\n";
43 43
 $user = new BoincUser();
44
-$user->id=0;
44
+$user->id = 0;
45 45
 $token = create_token($user->id, TOKEN_TYPE_DELETE_ACCOUNT, TOKEN_DURATION_ONE_DAY);
46
-if ( is_valid_token($user->id, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) {
46
+if (is_valid_token($user->id, $token, TOKEN_TYPE_DELETE_ACCOUNT)) {
47 47
     echo "Successfully created and validated delete account token";
48 48
 }
49 49
 
Please login to merge, or discard this patch.