Completed
Push — 1.11.x ( 696161...3ca1af )
by José
79:04 queued 37:53
created
main/inc/ajax/course_home.ajax.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -121,8 +121,9 @@  discard block
 block discarded – undo
121 121
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
122 122
             $my_session_list  = array();
123 123
             foreach($new_session_list as $item) {
124
-                if (!empty($item['id_session']))
125
-                    $my_session_list[] = $item['id_session'];
124
+                if (!empty($item['id_session'])) {
125
+                                    $my_session_list[] = $item['id_session'];
126
+                }
126 127
             }
127 128
             if (!in_array($session_id, $my_session_list)) {
128 129
             	break;
@@ -254,8 +255,9 @@  discard block
 block discarded – undo
254 255
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
255 256
             $my_session_list  = array();
256 257
             foreach($new_session_list as $item) {
257
-                if (!empty($item['id_session']))
258
-                    $my_session_list[] = $item['id_session'];
258
+                if (!empty($item['id_session'])) {
259
+                                    $my_session_list[] = $item['id_session'];
260
+                }
259 261
             }
260 262
             if (!in_array($session_id, $my_session_list)) {
261 263
                 break;
@@ -384,8 +386,9 @@  discard block
 block discarded – undo
384 386
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
385 387
             $my_session_list  = array();
386 388
             foreach($new_session_list as $item) {
387
-                if (!empty($item['id_session']))
388
-                    $my_session_list[] = $item['id_session'];
389
+                if (!empty($item['id_session'])) {
390
+                                    $my_session_list[] = $item['id_session'];
391
+                }
389 392
             }
390 393
             if (!in_array($session_id, $my_session_list)) {
391 394
                 break;
Please login to merge, or discard this patch.
main/inc/lib/usermanager.lib.php 1 patch
Braces   +97 added lines, -62 removed lines patch added patch discarded remove patch
@@ -774,10 +774,12 @@  discard block
 block discarded – undo
774 774
     public static function update_openid($user_id, $openid)
775 775
     {
776 776
         $table_user = Database :: get_main_table(TABLE_MAIN_USER);
777
-        if ($user_id != strval(intval($user_id)))
778
-            return false;
779
-        if ($user_id === false)
780
-            return false;
777
+        if ($user_id != strval(intval($user_id))) {
778
+                    return false;
779
+        }
780
+        if ($user_id === false) {
781
+                    return false;
782
+        }
781 783
         $sql = "UPDATE $table_user SET
782 784
                 openid='".Database::escape_string($openid)."'";
783 785
         $sql .= " WHERE id= $user_id";
@@ -2069,8 +2071,9 @@  discard block
 block discarded – undo
2069 2071
         if (empty($user_id)) {
2070 2072
             $user_id = 0;
2071 2073
         } else {
2072
-            if ($user_id != strval(intval($user_id)))
2073
-                return array();
2074
+            if ($user_id != strval(intval($user_id))) {
2075
+                            return array();
2076
+            }
2074 2077
         }
2075 2078
         $extra_data = array();
2076 2079
         $t_uf = Database::get_main_table(TABLE_EXTRA_FIELD);
@@ -2162,8 +2165,9 @@  discard block
 block discarded – undo
2162 2165
         if (empty($user_id)) {
2163 2166
             $user_id = 0;
2164 2167
         } else {
2165
-            if ($user_id != strval(intval($user_id)))
2166
-                return array();
2168
+            if ($user_id != strval(intval($user_id))) {
2169
+                            return array();
2170
+            }
2167 2171
         }
2168 2172
         $extra_data = array();
2169 2173
         $t_uf = Database::get_main_table(TABLE_EXTRA_FIELD);
@@ -2880,13 +2884,15 @@  discard block
 block discarded – undo
2880 2884
      */
2881 2885
     public static function get_api_keys($user_id = null, $api_service = 'dokeos')
2882 2886
     {
2883
-        if ($user_id != strval(intval($user_id)))
2884
-            return false;
2887
+        if ($user_id != strval(intval($user_id))) {
2888
+                    return false;
2889
+        }
2885 2890
         if (empty($user_id)) {
2886 2891
             $user_id = api_get_user_id();
2887 2892
         }
2888
-        if ($user_id === false)
2889
-            return false;
2893
+        if ($user_id === false) {
2894
+                    return false;
2895
+        }
2890 2896
         $service_name = Database::escape_string($api_service);
2891 2897
         if (is_string($service_name) === false) {
2892 2898
             return false;
@@ -2894,11 +2900,14 @@  discard block
 block discarded – undo
2894 2900
         $t_api = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
2895 2901
         $sql = "SELECT * FROM $t_api WHERE user_id = $user_id AND api_service='$api_service';";
2896 2902
         $res = Database::query($sql);
2897
-        if ($res === false)
2898
-            return false; //error during query
2903
+        if ($res === false) {
2904
+                    return false;
2905
+        }
2906
+        //error during query
2899 2907
         $num = Database::num_rows($res);
2900
-        if ($num == 0)
2901
-            return false;
2908
+        if ($num == 0) {
2909
+                    return false;
2910
+        }
2902 2911
         $list = array();
2903 2912
         while ($row = Database::fetch_array($res)) {
2904 2913
             $list[$row['id']] = $row['api_key'];
@@ -2913,13 +2922,15 @@  discard block
 block discarded – undo
2913 2922
      */
2914 2923
     public static function add_api_key($user_id = null, $api_service = 'dokeos')
2915 2924
     {
2916
-        if ($user_id != strval(intval($user_id)))
2917
-            return false;
2925
+        if ($user_id != strval(intval($user_id))) {
2926
+                    return false;
2927
+        }
2918 2928
         if (empty($user_id)) {
2919 2929
             $user_id = api_get_user_id();
2920 2930
         }
2921
-        if ($user_id === false)
2922
-            return false;
2931
+        if ($user_id === false) {
2932
+                    return false;
2933
+        }
2923 2934
         $service_name = Database::escape_string($api_service);
2924 2935
         if (is_string($service_name) === false) {
2925 2936
             return false;
@@ -2928,8 +2939,10 @@  discard block
 block discarded – undo
2928 2939
         $md5 = md5((time() + ($user_id * 5)) - rand(10000, 10000)); //generate some kind of random key
2929 2940
         $sql = "INSERT INTO $t_api (user_id, api_key,api_service) VALUES ($user_id,'$md5','$service_name')";
2930 2941
         $res = Database::query($sql);
2931
-        if ($res === false)
2932
-            return false; //error during query
2942
+        if ($res === false) {
2943
+                    return false;
2944
+        }
2945
+        //error during query
2933 2946
         $num = Database::insert_id();
2934 2947
         return ($num == 0) ? false : $num;
2935 2948
     }
@@ -2941,22 +2954,29 @@  discard block
 block discarded – undo
2941 2954
      */
2942 2955
     public static function delete_api_key($key_id)
2943 2956
     {
2944
-        if ($key_id != strval(intval($key_id)))
2945
-            return false;
2946
-        if ($key_id === false)
2947
-            return false;
2957
+        if ($key_id != strval(intval($key_id))) {
2958
+                    return false;
2959
+        }
2960
+        if ($key_id === false) {
2961
+                    return false;
2962
+        }
2948 2963
         $t_api = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
2949 2964
         $sql = "SELECT * FROM $t_api WHERE id = ".$key_id;
2950 2965
         $res = Database::query($sql);
2951
-        if ($res === false)
2952
-            return false; //error during query
2966
+        if ($res === false) {
2967
+                    return false;
2968
+        }
2969
+        //error during query
2953 2970
         $num = Database::num_rows($res);
2954
-        if ($num !== 1)
2955
-            return false;
2971
+        if ($num !== 1) {
2972
+                    return false;
2973
+        }
2956 2974
         $sql = "DELETE FROM $t_api WHERE id = ".$key_id;
2957 2975
         $res = Database::query($sql);
2958
-        if ($res === false)
2959
-            return false; //error during query
2976
+        if ($res === false) {
2977
+                    return false;
2978
+        }
2979
+        //error during query
2960 2980
         return true;
2961 2981
     }
2962 2982
 
@@ -2968,10 +2988,12 @@  discard block
 block discarded – undo
2968 2988
      */
2969 2989
     public static function update_api_key($user_id, $api_service)
2970 2990
     {
2971
-        if ($user_id != strval(intval($user_id)))
2972
-            return false;
2973
-        if ($user_id === false)
2974
-            return false;
2991
+        if ($user_id != strval(intval($user_id))) {
2992
+                    return false;
2993
+        }
2994
+        if ($user_id === false) {
2995
+                    return false;
2996
+        }
2975 2997
         $service_name = Database::escape_string($api_service);
2976 2998
         if (is_string($service_name) === false) {
2977 2999
             return false;
@@ -2997,12 +3019,15 @@  discard block
 block discarded – undo
2997 3019
      */
2998 3020
     public static function get_api_key_id($user_id, $api_service)
2999 3021
     {
3000
-        if ($user_id != strval(intval($user_id)))
3001
-            return false;
3002
-        if ($user_id === false)
3003
-            return false;
3004
-        if (empty($api_service))
3005
-            return false;
3022
+        if ($user_id != strval(intval($user_id))) {
3023
+                    return false;
3024
+        }
3025
+        if ($user_id === false) {
3026
+                    return false;
3027
+        }
3028
+        if (empty($api_service)) {
3029
+                    return false;
3030
+        }
3006 3031
         $t_api = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
3007 3032
         $api_service = Database::escape_string($api_service);
3008 3033
         $sql = "SELECT id FROM $t_api WHERE user_id=".$user_id." AND api_service='".$api_service."'";
@@ -4473,8 +4498,9 @@  discard block
 block discarded – undo
4473 4498
                     $form->applyFilter('extra_'.$field_details[1], 'stripslashes');
4474 4499
                     $form->applyFilter('extra_'.$field_details[1], 'trim');
4475 4500
                     if (!$admin_permissions) {
4476
-                        if ($field_details[7] == 0)
4477
-                            $form->freeze('extra_'.$field_details[1]);
4501
+                        if ($field_details[7] == 0) {
4502
+                                                    $form->freeze('extra_'.$field_details[1]);
4503
+                        }
4478 4504
                     }
4479 4505
                     break;
4480 4506
                 case ExtraField::FIELD_TYPE_RADIO:
@@ -4491,8 +4517,9 @@  discard block
 block discarded – undo
4491 4517
                     }
4492 4518
                     $form->addGroup($group, 'extra_'.$field_details[1], $field_details[3], '');
4493 4519
                     if (!$admin_permissions) {
4494
-                        if ($field_details[7] == 0)
4495
-                            $form->freeze('extra_'.$field_details[1]);
4520
+                        if ($field_details[7] == 0) {
4521
+                                                    $form->freeze('extra_'.$field_details[1]);
4522
+                        }
4496 4523
                     }
4497 4524
                     break;
4498 4525
                 case ExtraField::FIELD_TYPE_SELECT:
@@ -4530,8 +4557,9 @@  discard block
 block discarded – undo
4530 4557
                     );
4531 4558
 
4532 4559
                     if (!$admin_permissions) {
4533
-                        if ($field_details[7] == 0)
4534
-                            $form->freeze('extra_'.$field_details[1]);
4560
+                        if ($field_details[7] == 0) {
4561
+                                                    $form->freeze('extra_'.$field_details[1]);
4562
+                        }
4535 4563
                     }
4536 4564
                     break;
4537 4565
                 case ExtraField::FIELD_TYPE_SELECT_MULTIPLE:
@@ -4547,8 +4575,9 @@  discard block
 block discarded – undo
4547 4575
                         array('multiple' => 'multiple')
4548 4576
                     );
4549 4577
                     if (!$admin_permissions) {
4550
-                        if ($field_details[7] == 0)
4551
-                            $form->freeze('extra_'.$field_details[1]);
4578
+                        if ($field_details[7] == 0) {
4579
+                                                    $form->freeze('extra_'.$field_details[1]);
4580
+                        }
4552 4581
                     }
4553 4582
                     break;
4554 4583
                 case ExtraField::FIELD_TYPE_DATE:
@@ -4556,8 +4585,9 @@  discard block
 block discarded – undo
4556 4585
                     $defaults['extra_'.$field_details[1]] = date('Y-m-d 12:00:00');
4557 4586
                     $form->setDefaults($defaults);
4558 4587
                     if (!$admin_permissions) {
4559
-                        if ($field_details[7] == 0)
4560
-                            $form->freeze('extra_'.$field_details[1]);
4588
+                        if ($field_details[7] == 0) {
4589
+                                                    $form->freeze('extra_'.$field_details[1]);
4590
+                        }
4561 4591
                     }
4562 4592
                     $form->applyFilter('theme', 'trim');
4563 4593
                     break;
@@ -4566,8 +4596,9 @@  discard block
 block discarded – undo
4566 4596
                     $defaults['extra_'.$field_details[1]] = date('Y-m-d 12:00:00');
4567 4597
                     $form->setDefaults($defaults);
4568 4598
                     if (!$admin_permissions) {
4569
-                        if ($field_details[7] == 0)
4570
-                            $form->freeze('extra_'.$field_details[1]);
4599
+                        if ($field_details[7] == 0) {
4600
+                                                    $form->freeze('extra_'.$field_details[1]);
4601
+                        }
4571 4602
                     }
4572 4603
                     $form->applyFilter('theme', 'trim');
4573 4604
                     break;
@@ -4586,8 +4617,9 @@  discard block
 block discarded – undo
4586 4617
                     $form->addGroup($group, 'extra_'.$field_details[1], $field_details[3], ' ');
4587 4618
 
4588 4619
                     if (!$admin_permissions) {
4589
-                        if ($field_details[7] == 0)
4590
-                            $form->freeze('extra_'.$field_details[1]);
4620
+                        if ($field_details[7] == 0) {
4621
+                                                    $form->freeze('extra_'.$field_details[1]);
4622
+                        }
4591 4623
                     }
4592 4624
 
4593 4625
                     /* Recoding the selected values for double : if the user has
@@ -4647,8 +4679,9 @@  discard block
 block discarded – undo
4647 4679
                     break;
4648 4680
                 case ExtraField::FIELD_TYPE_TIMEZONE:
4649 4681
                     $form->addElement('select', 'extra_'.$field_details[1], $field_details[3], api_get_timezones(), '');
4650
-                    if ($field_details[7] == 0)
4651
-                        $form->freeze('extra_'.$field_details[1]);
4682
+                    if ($field_details[7] == 0) {
4683
+                                            $form->freeze('extra_'.$field_details[1]);
4684
+                    }
4652 4685
                     break;
4653 4686
                 case ExtraField::FIELD_TYPE_SOCIAL_PROFILE:
4654 4687
                     // get the social network's favicon
@@ -4673,8 +4706,9 @@  discard block
 block discarded – undo
4673 4706
                     );
4674 4707
                     $form->applyFilter('extra_'.$field_details[1], 'stripslashes');
4675 4708
                     $form->applyFilter('extra_'.$field_details[1], 'trim');
4676
-                    if ($field_details[7] == 0)
4677
-                        $form->freeze('extra_'.$field_details[1]);
4709
+                    if ($field_details[7] == 0) {
4710
+                                            $form->freeze('extra_'.$field_details[1]);
4711
+                    }
4678 4712
                     break;
4679 4713
                 case ExtraField::FIELD_TYPE_FILE:
4680 4714
                     $extra_field = 'extra_'.$field_details[1];
@@ -4991,8 +5025,9 @@  discard block
 block discarded – undo
4991 5025
         $url .= "?s=$s&d=$d&r=$r";
4992 5026
         if ( $img ) {
4993 5027
             $url = '<img src="' . $url . '"';
4994
-            foreach ( $atts as $key => $val )
4995
-                $url .= ' ' . $key . '="' . $val . '"';
5028
+            foreach ( $atts as $key => $val ) {
5029
+                            $url .= ' ' . $key . '="' . $val . '"';
5030
+            }
4996 5031
             $url .= ' />';
4997 5032
         }
4998 5033
         return $url;
Please login to merge, or discard this patch.
main/inc/lib/sub_language.class.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,9 @@
 block discarded – undo
29 29
                 while (($file = readdir($dh)) !== false) {
30 30
                     if ($file[0] <> '.' && substr($file, -4, strlen($file)) == '.php') {
31 31
                         if ($only_main_name) {
32
-                            if ($file != '' && strpos($file, '.inc.php'))
33
-                                $content_dir[] = substr($file, 0, strpos($file, '.inc.php'));
32
+                            if ($file != '' && strpos($file, '.inc.php')) {
33
+                                                            $content_dir[] = substr($file, 0, strpos($file, '.inc.php'));
34
+                            }
34 35
                         } else {
35 36
                             $content_dir[] = $file;
36 37
                         }
Please login to merge, or discard this patch.
main/inc/lib/database.lib.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -594,7 +594,7 @@
 block discarded – undo
594 594
                     if (!empty($limit_array)) {
595 595
                         if (count($limit_array) > 1) {
596 596
                             $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]);
597
-                        }  else {
597
+                        } else {
598 598
                             $return_value .= ' LIMIT '.intval($limit_array[0]);
599 599
                         }
600 600
                     }
Please login to merge, or discard this patch.
main/inc/lib/diagnoser.lib.php 1 patch
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -158,8 +158,9 @@  discard block
 block discarded – undo
158 158
         $array[] = $this->build_setting($status, '[INI]', 'display_errors', 'http://www.php.net/manual/en/ini.core.php#ini.display_errors', $setting, $req_setting, 'on_off', get_lang('DisplayErrorsInfo'));
159 159
 
160 160
         $setting = ini_get('default_charset');
161
-        if ($setting == '')
162
-            $setting = null;
161
+        if ($setting == '') {
162
+                    $setting = null;
163
+        }
163 164
         $req_setting = null;
164 165
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_ERROR;
165 166
         $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo'));
@@ -177,22 +178,25 @@  discard block
 block discarded – undo
177 178
         $setting = ini_get('memory_limit');
178 179
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
179 180
         $status = self :: STATUS_ERROR;
180
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
181
-            $status = self :: STATUS_OK;
181
+        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT) {
182
+                    $status = self :: STATUS_OK;
183
+        }
182 184
         $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo'));
183 185
 
184 186
         $setting = ini_get('post_max_size');
185 187
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
186 188
         $status = self :: STATUS_ERROR;
187
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
188
-            $status = self :: STATUS_OK;
189
+        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE) {
190
+                    $status = self :: STATUS_OK;
191
+        }
189 192
         $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo'));
190 193
 
191 194
         $setting = ini_get('upload_max_filesize');
192 195
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
193 196
         $status = self :: STATUS_ERROR;
194
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
195
-            $status = self :: STATUS_OK;
197
+        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) {
198
+                    $status = self :: STATUS_OK;
199
+        }
196 200
         $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo'));
197 201
 
198 202
         $setting = ini_get('variables_order');
@@ -205,7 +209,7 @@  discard block
 block discarded – undo
205 209
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
206 210
         $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo'));
207 211
 
208
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
212
+        if (api_check_browscap()){$setting = true;} else{$setting=false;}
209 213
         $req_setting = true;
210 214
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
211 215
         $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo'));
Please login to merge, or discard this patch.
main/inc/lib/notebook.lib.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -219,10 +219,10 @@
 block discarded – undo
219 219
         // action links
220 220
         echo '<div class="actions">';
221 221
         if (!api_is_anonymous()) {
222
-            if (api_get_session_id() == 0)
223
-                echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
222
+            if (api_get_session_id() == 0) {
223
+                            echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
224 224
                     Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
225
-            elseif (api_is_allowed_to_session_edit(false, true)) {
225
+            } elseif (api_is_allowed_to_session_edit(false, true)) {
226 226
                 echo '<a href="index.php?' . api_get_cidreq() . '&action=addnote">' .
227 227
                     Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32') . '</a>';
228 228
             }
Please login to merge, or discard this patch.
main/inc/lib/display.lib.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -666,9 +666,10 @@
 block discarded – undo
666 666
         $result = '';
667 667
         for ($i = $min; $i <= $max; $i ++) {
668 668
             $result .= '<option value="'.$i.'"';
669
-            if (is_int($selected_num))
670
-                if ($selected_num == $i) {
669
+            if (is_int($selected_num)) {
670
+                            if ($selected_num == $i) {
671 671
                     $result .= ' selected="selected"';
672
+            }
672 673
                 }
673 674
             $result .= '>'.$i.'</option>';
674 675
         }
Please login to merge, or discard this patch.
main/inc/lib/events.lib.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -333,8 +333,12 @@  discard block
 block discarded – undo
333 333
     ) {
334 334
         global $debug;
335 335
 
336
-        if ($debug) error_log('Called to update_event_exercice');
337
-        if ($debug) error_log('duration:' . $duration);
336
+        if ($debug) {
337
+            error_log('Called to update_event_exercice');
338
+        }
339
+        if ($debug) {
340
+            error_log('duration:' . $duration);
341
+        }
338 342
 
339 343
         if ($exeid != '') {
340 344
             /*
@@ -386,8 +390,12 @@  discard block
 block discarded – undo
386 390
         		 WHERE exe_id = '".Database::escape_string($exeid)."'";
387 391
             $res = Database::query($sql);
388 392
 
389
-            if ($debug) error_log('update_event_exercice called');
390
-            if ($debug) error_log("$sql");
393
+            if ($debug) {
394
+                error_log('update_event_exercice called');
395
+            }
396
+            if ($debug) {
397
+                error_log("$sql");
398
+            }
391 399
 
392 400
             //Deleting control time session track
393 401
             //ExerciseLib::exercise_time_control_delete($exo_id);
Please login to merge, or discard this patch.
main/inc/lib/search/xapian/XapianIndexer.class.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,13 +70,16 @@
 block discarded – undo
70 70
      */
71 71
     function connectDb($path = null, $dbMode = null, $lang = 'english')
72 72
     {
73
-        if ($this->db != null)
74
-            return $this->db;
75
-        if ($dbMode == null)
76
-            $dbMode = Xapian::DB_CREATE_OR_OPEN;
73
+        if ($this->db != null) {
74
+                    return $this->db;
75
+        }
76
+        if ($dbMode == null) {
77
+                    $dbMode = Xapian::DB_CREATE_OR_OPEN;
78
+        }
77 79
 
78
-        if ($path == null)
79
-            $path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/';
80
+        if ($path == null) {
81
+                    $path = api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/';
82
+        }
80 83
 
81 84
         try {
82 85
             $this->db = new XapianWritableDatabase($path, $dbMode);
Please login to merge, or discard this patch.