Completed
Pull Request — master (#2472)
by Kevin
11:48
created
html/inc/password_compat/password.inc 1 patch
Switch Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -50,47 +50,47 @@  discard block
 block discarded – undo
50 50
             }
51 51
             $resultLength = 0;
52 52
             switch ($algo) {
53
-                case PASSWORD_BCRYPT:
54
-                    $cost = PASSWORD_BCRYPT_DEFAULT_COST;
55
-                    if (isset($options['cost'])) {
56
-                        $cost = (int) $options['cost'];
57
-                        if ($cost < 4 || $cost > 31) {
58
-                            trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
59
-                            return null;
60
-                        }
53
+            case PASSWORD_BCRYPT:
54
+                $cost = PASSWORD_BCRYPT_DEFAULT_COST;
55
+                if (isset($options['cost'])) {
56
+                    $cost = (int) $options['cost'];
57
+                    if ($cost < 4 || $cost > 31) {
58
+                        trigger_error(sprintf("password_hash(): Invalid bcrypt cost parameter specified: %d", $cost), E_USER_WARNING);
59
+                        return null;
61 60
                     }
62
-                    // The length of salt to generate
63
-                    $raw_salt_len = 16;
64
-                    // The length required in the final serialization
65
-                    $required_salt_len = 22;
66
-                    $hash_format = sprintf("$2y$%02d$", $cost);
67
-                    // The expected length of the final crypt() output
68
-                    $resultLength = 60;
69
-                    break;
70
-                default:
71
-                    trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
72
-                    return null;
61
+                }
62
+                // The length of salt to generate
63
+                $raw_salt_len = 16;
64
+                // The length required in the final serialization
65
+                $required_salt_len = 22;
66
+                $hash_format = sprintf("$2y$%02d$", $cost);
67
+                // The expected length of the final crypt() output
68
+                $resultLength = 60;
69
+                break;
70
+            default:
71
+                trigger_error(sprintf("password_hash(): Unknown password hashing algorithm: %s", $algo), E_USER_WARNING);
72
+                return null;
73 73
             }
74 74
             $salt_req_encoding = false;
75 75
             if (isset($options['salt'])) {
76 76
                 switch (gettype($options['salt'])) {
77
-                    case 'NULL':
78
-                    case 'boolean':
79
-                    case 'integer':
80
-                    case 'double':
81
-                    case 'string':
77
+                case 'NULL':
78
+                case 'boolean':
79
+                case 'integer':
80
+                case 'double':
81
+                case 'string':
82
+                    $salt = (string) $options['salt'];
83
+                    break;
84
+                case 'object':
85
+                    if (method_exists($options['salt'], '__tostring')) {
82 86
                         $salt = (string) $options['salt'];
83 87
                         break;
84
-                    case 'object':
85
-                        if (method_exists($options['salt'], '__tostring')) {
86
-                            $salt = (string) $options['salt'];
87
-                            break;
88
-                        }
89
-                    case 'array':
90
-                    case 'resource':
91
-                    default:
92
-                        trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
93
-                        return null;
88
+                    }
89
+                case 'array':
90
+                case 'resource':
91
+                default:
92
+                    trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);
93
+                    return null;
94 94
                 }
95 95
                 if (PasswordCompat\binary\_strlen($salt) < $required_salt_len) {
96 96
                     trigger_error(sprintf("password_hash(): Provided salt is too short: %d expecting %d", PasswordCompat\binary\_strlen($salt), $required_salt_len), E_USER_WARNING);
@@ -212,12 +212,12 @@  discard block
 block discarded – undo
212 212
                 return true;
213 213
             }
214 214
             switch ($algo) {
215
-                case PASSWORD_BCRYPT:
216
-                    $cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
217
-                    if ($cost !== $info['options']['cost']) {
218
-                        return true;
219
-                    }
220
-                    break;
215
+            case PASSWORD_BCRYPT:
216
+                $cost = isset($options['cost']) ? (int) $options['cost'] : PASSWORD_BCRYPT_DEFAULT_COST;
217
+                if ($cost !== $info['options']['cost']) {
218
+                    return true;
219
+                }
220
+                break;
221 221
             }
222 222
             return false;
223 223
         }
Please login to merge, or discard this patch.
filefield_meta/includes/filefield_meta_handler_field_samplerate.inc 1 patch
Switch Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@
 block discarded – undo
50 50
     }
51 51
 
52 52
     switch ($this->options['format']) {
53
-      case 'raw':
54
-        $output = $value;
55
-        break;
56
-      default:
57
-        $output = theme('filefield_meta_samplerate', $value);
53
+    case 'raw':
54
+      $output = $value;
55
+      break;
56
+    default:
57
+      $output = theme('filefield_meta_samplerate', $value);
58 58
     }
59 59
 
60 60
     return check_plain($this->options['prefix']) . $output . check_plain($this->options['suffix']);
Please login to merge, or discard this patch.
filefield/filefield_meta/includes/filefield_meta_handler_field_duration.inc 1 patch
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -48,20 +48,20 @@
 block discarded – undo
48 48
     $value = $values->{$this->field_alias};
49 49
 
50 50
     switch ($this->options['format']) {
51
-      case 'hours':
52
-        $output = date('g', (int) $value);
53
-        break;
54
-      case 'minutes':
55
-        $output = date('i', (int) $value);
56
-        break;
57
-      case 'seconds':
58
-        $output = date('s', (int) $value);
59
-        break;
60
-      case 'total':
61
-        $output = check_plain($value);
62
-        break;
63
-      default:
64
-        $output = theme('filefield_meta_duration', $value);
51
+    case 'hours':
52
+      $output = date('g', (int) $value);
53
+      break;
54
+    case 'minutes':
55
+      $output = date('i', (int) $value);
56
+      break;
57
+    case 'seconds':
58
+      $output = date('s', (int) $value);
59
+      break;
60
+    case 'total':
61
+      $output = check_plain($value);
62
+      break;
63
+    default:
64
+      $output = theme('filefield_meta_duration', $value);
65 65
     }
66 66
 
67 67
     // Check to see if hiding should happen before adding prefix and suffix.
Please login to merge, or discard this patch.
filefield/filefield_meta/includes/filefield_meta_handler_field_bitrate.inc 1 patch
Switch Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@
 block discarded – undo
50 50
     }
51 51
 
52 52
     switch ($this->options['format']) {
53
-      case 'raw':
54
-        $output = $value;
55
-        break;
56
-      default:
57
-        $output = theme('filefield_meta_bitrate', $value);
53
+    case 'raw':
54
+      $output = $value;
55
+      break;
56
+    default:
57
+      $output = theme('filefield_meta_bitrate', $value);
58 58
     }
59 59
 
60 60
     return check_plain($this->options['prefix']) . $output . check_plain($this->options['suffix']);
Please login to merge, or discard this patch.
default/boinc/modules/contrib/filefield/views/filefield.views_convert.inc 1 patch
Switch Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -22,19 +22,19 @@  discard block
 block discarded – undo
22 22
             unset($fields['table']);
23 23
             foreach ($fields as $filefield_field => $definition) {
24 24
               switch ($filefield_field) {
25
-                case $content_field['field_name'] .'_fid':
26
-                  $filefield_fields[$filefield_field] = array(
27
-                    'table' => $table,
28
-                    'field' => $filefield_field,
29
-                  );
30
-                  $filefield_arguments['content: '. $content_field['field_name']] = &$filefield_fields[$filefield_field];
31
-                  break;
32
-                case $content_field['field_name'] .'_list':
33
-                  $filefield_filters[$content_field['field_name'] .'_fid_not null'] = array(
34
-                    'table' => $table,
35
-                    'field' => $filefield_field,
36
-                  );
37
-                  break;
25
+              case $content_field['field_name'] .'_fid':
26
+                $filefield_fields[$filefield_field] = array(
27
+                  'table' => $table,
28
+                  'field' => $filefield_field,
29
+                );
30
+                $filefield_arguments['content: '. $content_field['field_name']] = &$filefield_fields[$filefield_field];
31
+                break;
32
+              case $content_field['field_name'] .'_list':
33
+                $filefield_filters[$content_field['field_name'] .'_fid_not null'] = array(
34
+                  'table' => $table,
35
+                  'field' => $filefield_field,
36
+                );
37
+                break;
38 38
               }
39 39
             }
40 40
           }
@@ -43,39 +43,39 @@  discard block
 block discarded – undo
43 43
     }
44 44
   }
45 45
   switch ($type) {
46
-    case 'field':
47
-      if (isset($filefield_fields[$field['field']])) {
48
-        $multiple = array();
49
-        switch ($field['handler']) {
50
-          case 'content_views_field_handler_ungroup':
51
-            $view->set_item_option($display, 'field', $id, 'multiple', array('group' => FALSE));
52
-            break;
53
-          case 'content_views_field_handler_last':
54
-            $multiple['multiple_reversed'] = TRUE;
55
-          case 'content_views_field_handler_first':
56
-            $multiple['multiple_number'] = 1;
57
-            $view->set_item_option($display, 'field', $id, 'multiple', $multiple);
58
-            break;
59
-        }
60
-        $view->set_item_option($display, 'field', $id, 'format', $field['options']);
61
-      }
46
+  case 'field':
47
+    if (isset($filefield_fields[$field['field']])) {
48
+      $multiple = array();
49
+      switch ($field['handler']) {
50
+      case 'content_views_field_handler_ungroup':
51
+      $view->set_item_option($display, 'field', $id, 'multiple', array('group' => FALSE));
62 52
       break;
63
-    case 'filter':
64
-      if (isset($filefield_filters[$field['field']])) {
65
-        $filter = $filefield_filters[$field['field']];
66
-        $item = $view->get_item($display, 'filter', $id);
67
-        $item['value'] = $field['value'];
68
-        $item['table'] = $filter['table'];
69
-        $item['field'] = $filter['field'];
70
-        $view->set_item($display, 'filter', $id, $item);
71
-      }
53
+      case 'content_views_field_handler_last':
54
+      $multiple['multiple_reversed'] = TRUE;
55
+      case 'content_views_field_handler_first':
56
+      $multiple['multiple_number'] = 1;
57
+      $view->set_item_option($display, 'field', $id, 'multiple', $multiple);
72 58
       break;
73
-    case 'argument':
74
-      if (isset($filefield_arguments[$field['type']])) {
75
-        $argument = $filefield_arguments[$field['type']];
76
-        $options = $field['argoptions'];
77
-        $view->add_item($display, 'argument', $argument['table'], $argument['field'], $options, $field['id']);
59
+      }
60
+        $view->set_item_option($display, 'field', $id, 'format', $field['options']);
78 61
       }
79 62
       break;
63
+  case 'filter':
64
+    if (isset($filefield_filters[$field['field']])) {
65
+      $filter = $filefield_filters[$field['field']];
66
+      $item = $view->get_item($display, 'filter', $id);
67
+      $item['value'] = $field['value'];
68
+      $item['table'] = $filter['table'];
69
+      $item['field'] = $filter['field'];
70
+      $view->set_item($display, 'filter', $id, $item);
71
+    }
72
+    break;
73
+  case 'argument':
74
+    if (isset($filefield_arguments[$field['type']])) {
75
+      $argument = $filefield_arguments[$field['type']];
76
+      $options = $field['argoptions'];
77
+      $view->add_item($display, 'argument', $argument['table'], $argument['field'], $options, $field['id']);
78
+    }
79
+    break;
80 80
   }
81 81
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/filefield/filefield.theme.inc 1 patch
Switch Indentation   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -123,126 +123,126 @@
 block discarded – undo
123 123
 function _filefield_generic_icon_map($file) {
124 124
   switch ($file['filemime']) {
125 125
     // Word document types.
126
-    case 'application/msword':
127
-    case 'application/vnd.ms-word.document.macroEnabled.12':
128
-    case 'application/vnd.oasis.opendocument.text':
129
-    case 'application/vnd.oasis.opendocument.text-template':
130
-    case 'application/vnd.oasis.opendocument.text-master':
131
-    case 'application/vnd.oasis.opendocument.text-web':
132
-    case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
133
-    case 'application/vnd.stardivision.writer':
134
-    case 'application/vnd.sun.xml.writer':
135
-    case 'application/vnd.sun.xml.writer.template':
136
-    case 'application/vnd.sun.xml.writer.global':
137
-    case 'application/vnd.wordperfect':
138
-    case 'application/x-abiword':
139
-    case 'application/x-applix-word':
140
-    case 'application/x-kword':
141
-    case 'application/x-kword-crypt':
142
-      return 'x-office-document';
143
-
144
-    // Spreadsheet document types.
145
-    case 'application/vnd.ms-excel':
146
-    case 'application/vnd.ms-excel.sheet.macroEnabled.12':
147
-    case 'application/vnd.oasis.opendocument.spreadsheet':
148
-    case 'application/vnd.oasis.opendocument.spreadsheet-template':
149
-    case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
150
-    case 'application/vnd.stardivision.calc':
151
-    case 'application/vnd.sun.xml.calc':
152
-    case 'application/vnd.sun.xml.calc.template':
153
-    case 'application/vnd.lotus-1-2-3':
154
-    case 'application/x-applix-spreadsheet':
155
-    case 'application/x-gnumeric':
156
-    case 'application/x-kspread':
157
-    case 'application/x-kspread-crypt':
158
-      return 'x-office-spreadsheet';
159
-
160
-    // Presentation document types.
161
-    case 'application/vnd.ms-powerpoint':
162
-    case 'application/vnd.ms-powerpoint.presentation.macroEnabled.12':
163
-    case 'application/vnd.oasis.opendocument.presentation':
164
-    case 'application/vnd.oasis.opendocument.presentation-template':
165
-    case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
166
-    case 'application/vnd.openxmlformats-officedocument.presentationml.slideshow':
167
-    case 'application/vnd.stardivision.impress':
168
-    case 'application/vnd.sun.xml.impress':
169
-    case 'application/vnd.sun.xml.impress.template':
170
-    case 'application/x-kpresenter':
171
-      return 'x-office-presentation';
172
-
173
-    // Compressed archive types.
174
-    case 'application/zip':
175
-    case 'application/x-zip':
176
-    case 'application/stuffit':
177
-    case 'application/x-stuffit':
178
-    case 'application/x-7z-compressed':
179
-    case 'application/x-ace':
180
-    case 'application/x-arj':
181
-    case 'application/x-bzip':
182
-    case 'application/x-bzip-compressed-tar':
183
-    case 'application/x-compress':
184
-    case 'application/x-compressed-tar':
185
-    case 'application/x-cpio-compressed':
186
-    case 'application/x-deb':
187
-    case 'application/x-gzip':
188
-    case 'application/x-java-archive':
189
-    case 'application/x-lha':
190
-    case 'application/x-lhz':
191
-    case 'application/x-lzop':
192
-    case 'application/x-rar':
193
-    case 'application/x-rpm':
194
-    case 'application/x-tzo':
195
-    case 'application/x-tar':
196
-    case 'application/x-tarz':
197
-    case 'application/x-tgz':
198
-      return 'package-x-generic';
199
-
200
-    // Script file types.
201
-    case 'application/ecmascript':
202
-    case 'application/javascript':
203
-    case 'application/mathematica':
204
-    case 'application/vnd.mozilla.xul+xml':
205
-    case 'application/x-asp':
206
-    case 'application/x-awk':
207
-    case 'application/x-cgi':
208
-    case 'application/x-csh':
209
-    case 'application/x-m4':
210
-    case 'application/x-perl':
211
-    case 'application/x-php':
212
-    case 'application/x-ruby':
213
-    case 'application/x-shellscript':
214
-    case 'text/vnd.wap.wmlscript':
215
-    case 'text/x-emacs-lisp':
216
-    case 'text/x-haskell':
217
-    case 'text/x-literate-haskell':
218
-    case 'text/x-lua':
219
-    case 'text/x-makefile':
220
-    case 'text/x-matlab':
221
-    case 'text/x-python':
222
-    case 'text/x-sql':
223
-    case 'text/x-tcl':
224
-      return 'text-x-script';
225
-
226
-    // HTML aliases.
227
-    case 'application/xhtml+xml':
228
-      return 'text-html';
229
-
230
-    // RTF files.
231
-    case 'application/rtf':
232
-      return 'text-rtf';
233
-
234
-    // Google earth files.
235
-    case 'application/vnd.google-earth.kml+xml':
236
-    case 'application/vnd.google-earth.kmz':
237
-      return 'application-google-earth';
238
-
239
-    // Executable types.
240
-    case 'application/x-macbinary':
241
-    case 'application/x-ms-dos-executable':
242
-    case 'application/x-pef-executable':
243
-      return 'application-x-executable';
244
-
245
-    default:
246
-      return FALSE;
126
+  case 'application/msword':
127
+  case 'application/vnd.ms-word.document.macroEnabled.12':
128
+  case 'application/vnd.oasis.opendocument.text':
129
+  case 'application/vnd.oasis.opendocument.text-template':
130
+  case 'application/vnd.oasis.opendocument.text-master':
131
+  case 'application/vnd.oasis.opendocument.text-web':
132
+  case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
133
+  case 'application/vnd.stardivision.writer':
134
+  case 'application/vnd.sun.xml.writer':
135
+  case 'application/vnd.sun.xml.writer.template':
136
+  case 'application/vnd.sun.xml.writer.global':
137
+  case 'application/vnd.wordperfect':
138
+  case 'application/x-abiword':
139
+  case 'application/x-applix-word':
140
+  case 'application/x-kword':
141
+  case 'application/x-kword-crypt':
142
+    return 'x-office-document';
143
+
144
+  // Spreadsheet document types.
145
+  case 'application/vnd.ms-excel':
146
+  case 'application/vnd.ms-excel.sheet.macroEnabled.12':
147
+  case 'application/vnd.oasis.opendocument.spreadsheet':
148
+  case 'application/vnd.oasis.opendocument.spreadsheet-template':
149
+  case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
150
+  case 'application/vnd.stardivision.calc':
151
+  case 'application/vnd.sun.xml.calc':
152
+  case 'application/vnd.sun.xml.calc.template':
153
+  case 'application/vnd.lotus-1-2-3':
154
+  case 'application/x-applix-spreadsheet':
155
+  case 'application/x-gnumeric':
156
+  case 'application/x-kspread':
157
+  case 'application/x-kspread-crypt':
158
+    return 'x-office-spreadsheet';
159
+
160
+  // Presentation document types.
161
+  case 'application/vnd.ms-powerpoint':
162
+  case 'application/vnd.ms-powerpoint.presentation.macroEnabled.12':
163
+  case 'application/vnd.oasis.opendocument.presentation':
164
+  case 'application/vnd.oasis.opendocument.presentation-template':
165
+  case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
166
+  case 'application/vnd.openxmlformats-officedocument.presentationml.slideshow':
167
+  case 'application/vnd.stardivision.impress':
168
+  case 'application/vnd.sun.xml.impress':
169
+  case 'application/vnd.sun.xml.impress.template':
170
+  case 'application/x-kpresenter':
171
+    return 'x-office-presentation';
172
+
173
+  // Compressed archive types.
174
+  case 'application/zip':
175
+  case 'application/x-zip':
176
+  case 'application/stuffit':
177
+  case 'application/x-stuffit':
178
+  case 'application/x-7z-compressed':
179
+  case 'application/x-ace':
180
+  case 'application/x-arj':
181
+  case 'application/x-bzip':
182
+  case 'application/x-bzip-compressed-tar':
183
+  case 'application/x-compress':
184
+  case 'application/x-compressed-tar':
185
+  case 'application/x-cpio-compressed':
186
+  case 'application/x-deb':
187
+  case 'application/x-gzip':
188
+  case 'application/x-java-archive':
189
+  case 'application/x-lha':
190
+  case 'application/x-lhz':
191
+  case 'application/x-lzop':
192
+  case 'application/x-rar':
193
+  case 'application/x-rpm':
194
+  case 'application/x-tzo':
195
+  case 'application/x-tar':
196
+  case 'application/x-tarz':
197
+  case 'application/x-tgz':
198
+    return 'package-x-generic';
199
+
200
+  // Script file types.
201
+  case 'application/ecmascript':
202
+  case 'application/javascript':
203
+  case 'application/mathematica':
204
+  case 'application/vnd.mozilla.xul+xml':
205
+  case 'application/x-asp':
206
+  case 'application/x-awk':
207
+  case 'application/x-cgi':
208
+  case 'application/x-csh':
209
+  case 'application/x-m4':
210
+  case 'application/x-perl':
211
+  case 'application/x-php':
212
+  case 'application/x-ruby':
213
+  case 'application/x-shellscript':
214
+  case 'text/vnd.wap.wmlscript':
215
+  case 'text/x-emacs-lisp':
216
+  case 'text/x-haskell':
217
+  case 'text/x-literate-haskell':
218
+  case 'text/x-lua':
219
+  case 'text/x-makefile':
220
+  case 'text/x-matlab':
221
+  case 'text/x-python':
222
+  case 'text/x-sql':
223
+  case 'text/x-tcl':
224
+    return 'text-x-script';
225
+
226
+  // HTML aliases.
227
+  case 'application/xhtml+xml':
228
+    return 'text-html';
229
+
230
+  // RTF files.
231
+  case 'application/rtf':
232
+    return 'text-rtf';
233
+
234
+  // Google earth files.
235
+  case 'application/vnd.google-earth.kml+xml':
236
+  case 'application/vnd.google-earth.kmz':
237
+    return 'application-google-earth';
238
+
239
+  // Executable types.
240
+  case 'application/x-macbinary':
241
+  case 'application/x-ms-dos-executable':
242
+  case 'application/x-pef-executable':
243
+    return 'application-x-executable';
244
+
245
+  default:
246
+    return FALSE;
247 247
   }
248 248
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/contrib/filefield/filefield.module 1 patch
Switch Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -313,10 +313,10 @@
 block discarded – undo
313 313
  */
314 314
 function filefield_widget_settings($op, $widget) {
315 315
   switch ($op) {
316
-    case 'form':
317
-      return filefield_widget_settings_form($widget);
318
-    case 'save':
319
-      return filefield_widget_settings_save($widget);
316
+  case 'form':
317
+    return filefield_widget_settings_form($widget);
318
+  case 'save':
319
+    return filefield_widget_settings_save($widget);
320 320
   }
321 321
 }
322 322
 
Please login to merge, or discard this patch.