Passed
Push — 1.10.x ( 51b3f0...0b3bd8 )
by Yannick
116:33 queued 61:35
created
main/inc/lib/phpmailer/class.phpmailer.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
  * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
39 39
  */
40 40
 
41
-if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n");
41
+if (version_compare(PHP_VERSION, '5.0.0', '<') ) {
42
+    exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n");
43
+}
42 44
 
43 45
 class PHPMailer {
44 46
 
@@ -1502,8 +1504,9 @@  discard block
 block discarded – undo
1502 1504
       case '8bit':
1503 1505
         $encoded = $this->FixEOL($str);
1504 1506
         //Make sure it ends with a line break
1505
-        if (substr($encoded, -(strlen($this->LE))) != $this->LE)
1506
-          $encoded .= $this->LE;
1507
+        if (substr($encoded, -(strlen($this->LE))) != $this->LE) {
1508
+                  $encoded .= $this->LE;
1509
+        }
1507 1510
         break;
1508 1511
       case 'binary':
1509 1512
         $encoded = $str;
@@ -2264,7 +2267,9 @@  discard block
 block discarded – undo
2264 2267
    * @param string $body Message Body
2265 2268
    */
2266 2269
   public function DKIM_BodyC($body) {
2267
-    if ($body == '') return "\r\n";
2270
+    if ($body == '') {
2271
+        return "\r\n";
2272
+    }
2268 2273
     // stabilize line endings
2269 2274
     $body=str_replace("\r\n","\n",$body);
2270 2275
     $body=str_replace("\n","\r\n",$body);
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/legal.lib.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -198,12 +198,14 @@
 block discarded – undo
198 198
 			//echo strlen($legal[1]); echo '<br>';
199 199
 			$versions[]=$legal[0];
200 200
 			$languages[]=$legal[1];
201
-			if (strlen($legal[2])>2000)
202
-				$legal[2]= substr($legal[2],0,2000).' ... ';
203
-			if ($legal[4]==0)
204
-				$legal[4]= get_lang('HTMLText');
205
-			elseif($legal[4]==1)
206
-				$legal[4]=get_lang('PageLink');
201
+			if (strlen($legal[2])>2000) {
202
+							$legal[2]= substr($legal[2],0,2000).' ... ';
203
+			}
204
+			if ($legal[4]==0) {
205
+							$legal[4]= get_lang('HTMLText');
206
+			} elseif($legal[4]==1) {
207
+							$legal[4]=get_lang('PageLink');
208
+			}
207 209
 			$legals[] = $legal;
208 210
 		}
209 211
 		return $legals;
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/blog.lib.php 1 patch
Braces   +32 added lines, -22 removed lines patch added patch discarded remove patch
@@ -997,14 +997,17 @@  discard block
 block discarded – undo
997 997
 
998 998
 		$task_id = (isset($_GET['task_id']) && is_numeric($_GET['task_id'])) ? intval($_GET['task_id']) : 0;
999 999
 
1000
-		if (api_is_allowed('BLOG_' . $blog_id, 'article_edit', $task_id))
1001
-			$blog_post_actions .= '<a href="blog.php?action=edit_post&blog_id=' . $blog_id . '&post_id=' . $post_id . '&article_id=' . $blog_post['post_id'] . '&task_id=' . $task_id . '" title="' . get_lang('EditThisPost') . '"><img src="../img/edit.gif" /></a>';
1000
+		if (api_is_allowed('BLOG_' . $blog_id, 'article_edit', $task_id)) {
1001
+					$blog_post_actions .= '<a href="blog.php?action=edit_post&blog_id=' . $blog_id . '&post_id=' . $post_id . '&article_id=' . $blog_post['post_id'] . '&task_id=' . $task_id . '" title="' . get_lang('EditThisPost') . '"><img src="../img/edit.gif" /></a>';
1002
+		}
1002 1003
 
1003
-		if (api_is_allowed('BLOG_' . $blog_id, 'article_delete', $task_id))
1004
-			$blog_post_actions .= '<a href="blog.php?action=view_post&blog_id=' . $blog_id . '&post_id=' . $post_id . '&do=delete_article&article_id=' . $blog_post['post_id'] . '&task_id=' . $task_id . '" title="' . get_lang('DeleteThisArticle') . '" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)). '\')) return false;"><img src="../img/delete.gif" border="0" /></a>';
1004
+		if (api_is_allowed('BLOG_' . $blog_id, 'article_delete', $task_id)) {
1005
+					$blog_post_actions .= '<a href="blog.php?action=view_post&blog_id=' . $blog_id . '&post_id=' . $post_id . '&do=delete_article&article_id=' . $blog_post['post_id'] . '&task_id=' . $task_id . '" title="' . get_lang('DeleteThisArticle') . '" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)). '\')) return false;"><img src="../img/delete.gif" border="0" /></a>';
1006
+		}
1005 1007
 
1006
-		if(api_is_allowed('BLOG_' . $blog_id, 'article_rate'))
1007
-			$rating_select = Blog::display_rating_form('post',$blog_id,$post_id);
1008
+		if(api_is_allowed('BLOG_' . $blog_id, 'article_rate')) {
1009
+					$rating_select = Blog::display_rating_form('post',$blog_id,$post_id);
1010
+		}
1008 1011
 
1009 1012
 		$blog_post_text=stripslashes($blog_post_text);
1010 1013
 
@@ -1632,8 +1635,9 @@  discard block
 block discarded – undo
1632 1635
 
1633 1636
 						$arrPermissions = array();
1634 1637
 
1635
-						while ($row = Database::fetch_array($result))
1636
-							$arrPermissions[] = $row['action'];
1638
+						while ($row = Database::fetch_array($result)) {
1639
+													$arrPermissions[] = $row['action'];
1640
+						}
1637 1641
 
1638 1642
 						    echo '<tr>';
1639 1643
 							echo '<td style="text-align:right; vertical-align:top;">' . get_lang('TaskManager') . ':&nbsp;&nbsp;</td>';
@@ -2310,8 +2314,9 @@  discard block
 block discarded – undo
2310 2314
 		//Handle leap year
2311 2315
 		$numberofdays = array (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
2312 2316
 
2313
-		if(($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0))
2314
-			$numberofdays[2] = 29;
2317
+		if(($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) {
2318
+					$numberofdays[2] = 29;
2319
+		}
2315 2320
 
2316 2321
 		//Get the first day of the month
2317 2322
 		$dayone = getdate(mktime(0, 0, 0, $month, 1, $year));
@@ -2341,8 +2346,9 @@  discard block
 block discarded – undo
2341 2346
 		if( Database::num_rows($result) > 0) {
2342 2347
 			while($blog_post = Database::fetch_array($result)) {
2343 2348
 				// If the day of this post is not yet in the array, add it.
2344
-				if (!in_array($blog_post['post_day'], $posts))
2345
-					$posts[] = $blog_post['post_day'];
2349
+				if (!in_array($blog_post['post_day'], $posts)) {
2350
+									$posts[] = $blog_post['post_day'];
2351
+				}
2346 2352
 			}
2347 2353
 		}
2348 2354
 
@@ -2381,8 +2387,9 @@  discard block
 block discarded – undo
2381 2387
 
2382 2388
 		echo "<tr>\n";
2383 2389
 
2384
-		for($ii = 1; $ii < 8; $ii ++)
2385
-			echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
2390
+		for($ii = 1; $ii < 8; $ii ++) {
2391
+					echo "<td class=\"weekdays\">", $DaysShort[$ii % 7], "</td>";
2392
+		}
2386 2393
 
2387 2394
 		echo "</tr>";
2388 2395
 
@@ -2392,8 +2399,9 @@  discard block
 block discarded – undo
2392 2399
 		while ($curday <= $numberofdays[$month]) {
2393 2400
 			echo "<tr>";
2394 2401
 			for ($ii = 0; $ii < 7; $ii ++) {
2395
-				if (($curday == -1) && ($ii == $startdayofweek))
2396
-					$curday = 1;
2402
+				if (($curday == -1) && ($ii == $startdayofweek)) {
2403
+									$curday = 1;
2404
+				}
2397 2405
 
2398 2406
 			 	if (($curday > 0) && ($curday <= $numberofdays[$month])) {
2399 2407
 					$bgcolor = $ii < 5 ? $class="class=\"days_week\"" : $class="class=\"days_weekend\"";
@@ -2407,10 +2415,11 @@  discard block
 block discarded – undo
2407 2415
 					echo "<td " . $class.">";
2408 2416
 
2409 2417
 					// If there are posts on this day, create a filter link.
2410
-					if(in_array($curday, $posts))
2411
-						echo '<a href="blog.php?blog_id=' . $blog_id . '&filter=' . $year . '-' . $month . '-' . $curday . '&month=' . $month . '&year=' . $year . '" title="' . get_lang('ViewPostsOfThisDay') . '">' . $curday . '</a>';
2412
-					else
2413
-						echo $dayheader;
2418
+					if(in_array($curday, $posts)) {
2419
+											echo '<a href="blog.php?blog_id=' . $blog_id . '&filter=' . $year . '-' . $month . '-' . $curday . '&month=' . $month . '&year=' . $year . '" title="' . get_lang('ViewPostsOfThisDay') . '">' . $curday . '</a>';
2420
+					} else {
2421
+											echo $dayheader;
2422
+					}
2414 2423
 
2415 2424
 					if (count($tasks) > 0) {
2416 2425
 						if (isset($tasks[$curday]) && is_array($tasks[$curday])) {
@@ -2424,8 +2433,9 @@  discard block
 block discarded – undo
2424 2433
 
2425 2434
 					echo "</td>";
2426 2435
 					$curday ++;
2427
-				} else
2428
-					echo "<td>&nbsp;</td>";
2436
+				} else {
2437
+									echo "<td>&nbsp;</td>";
2438
+				}
2429 2439
 			}
2430 2440
 			echo "</tr>";
2431 2441
 		}
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/course.lib.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1880,7 +1880,7 @@  discard block
 block discarded – undo
1880 1880
                         $html .= Display::tag('li', Display::return_icon('teacher.png', $teacher, null, ICON_SIZE_TINY) . ' ' . $teacher);
1881 1881
                     }
1882 1882
                     $html .= '</ul>';
1883
-                }else{
1883
+                } else{
1884 1884
                     $html .= array_to_string($list, $separator);
1885 1885
                 }
1886 1886
             }
@@ -3236,7 +3236,7 @@  discard block
 block discarded – undo
3236 3236
             $html .= '<a class="thumbnail" href="'.$params['link'].'">';
3237 3237
             $html .= $params['icon'];
3238 3238
             $html .= '</a>';
3239
-        }else{
3239
+        } else{
3240 3240
             $html .= $params['icon'];
3241 3241
         }
3242 3242
         $html .= '</div>';
Please login to merge, or discard this patch.
main/inc/lib/social.lib.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1631,11 +1631,11 @@  discard block
 block discarded – undo
1631 1631
 
1632 1632
             if ($size == IMAGE_WALL_SMALL) {
1633 1633
                 $name = IMAGE_WALL_SMALL. '_' . $array[2];
1634
-            }else if($size == IMAGE_WALL_MEDIUM){
1634
+            } else if($size == IMAGE_WALL_MEDIUM){
1635 1635
                 $name = IMAGE_WALL_MEDIUM. '_' . $array[2];
1636
-            }else if($size == IMAGE_WALL_BIG){
1636
+            } else if($size == IMAGE_WALL_BIG){
1637 1637
                 $name = IMAGE_WALL_BIG. '_' . $array[2];
1638
-            }else {
1638
+            } else {
1639 1639
                 $name = IMAGE_WALL_SMALL. '_' . $array[2];
1640 1640
             }
1641 1641
             $lessImage = str_replace($array[2], '', $path);
@@ -1759,7 +1759,9 @@  discard block
 block discarded – undo
1759 1759
             $friendHtml.= '<ul class="nav nav-list">';
1760 1760
             $j = 1;
1761 1761
             for ($k=0; $k < $number_friends; $k++) {
1762
-                if ($j > $number_of_images) break;
1762
+                if ($j > $number_of_images) {
1763
+                    break;
1764
+                }
1763 1765
 
1764 1766
                 if (isset($friends[$k])) {
1765 1767
                     $friend = $friends[$k];
@@ -1815,7 +1817,9 @@  discard block
 block discarded – undo
1815 1817
             $friendHtml.= '<div class="list-group">';
1816 1818
             $j = 1;
1817 1819
             for ($k=0; $k < $number_friends; $k++) {
1818
-                if ($j > $number_of_images) break;
1820
+                if ($j > $number_of_images) {
1821
+                    break;
1822
+                }
1819 1823
 
1820 1824
                 if (isset($friends[$k])) {
1821 1825
                     $friend = $friends[$k];
Please login to merge, or discard this patch.
main/inc/lib/message.lib.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -131,8 +131,9 @@  discard block
 block discarded – undo
131 131
             $direction = 'DESC';
132 132
         } else {
133 133
             $column = intval($column);
134
-            if (!in_array($direction, array('ASC', 'DESC')))
135
-                $direction = 'ASC';
134
+            if (!in_array($direction, array('ASC', 'DESC'))) {
135
+                            $direction = 'ASC';
136
+            }
136 137
         }
137 138
         $table_message = Database::get_main_table(TABLE_MESSAGE);
138 139
 
@@ -488,8 +489,9 @@  discard block
 block discarded – undo
488 489
     public static function delete_message_by_user_receiver($user_receiver_id, $id)
489 490
     {
490 491
         $table_message = Database::get_main_table(TABLE_MESSAGE);
491
-        if ($id != strval(intval($id)))
492
-            return false;
492
+        if ($id != strval(intval($id))) {
493
+                    return false;
494
+        }
493 495
         $user_receiver_id = intval($user_receiver_id);
494 496
         $id = intval($id);
495 497
         $sql = "SELECT * FROM $table_message
@@ -664,8 +666,9 @@  discard block
 block discarded – undo
664 666
      */
665 667
     public static function update_message($user_id, $message_id)
666 668
     {
667
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
668
-            return false;
669
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
670
+                    return false;
671
+        }
669 672
 
670 673
         $table_message = Database::get_main_table(TABLE_MESSAGE);
671 674
         $sql = "UPDATE $table_message SET msg_status = '0'
@@ -705,8 +708,9 @@  discard block
 block discarded – undo
705 708
      */
706 709
     public static function get_message_by_user($user_id, $message_id)
707 710
     {
708
-        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id)))
709
-            return false;
711
+        if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) {
712
+                    return false;
713
+        }
710 714
         $table_message = Database::get_main_table(TABLE_MESSAGE);
711 715
         $query = "SELECT * FROM $table_message
712 716
                   WHERE user_receiver_id=".intval($user_id)." AND id='".intval($message_id)."'";
@@ -721,8 +725,9 @@  discard block
 block discarded – undo
721 725
      */
722 726
     public static function get_messages_by_group($group_id)
723 727
     {
724
-        if ($group_id != strval(intval($group_id)))
725
-            return false;
728
+        if ($group_id != strval(intval($group_id))) {
729
+                    return false;
730
+        }
726 731
 
727 732
         $table_message = Database::get_main_table(TABLE_MESSAGE);
728 733
         $group_id = intval($group_id);
@@ -749,8 +754,9 @@  discard block
 block discarded – undo
749 754
      */
750 755
     public static function get_messages_by_group_by_message($group_id, $message_id)
751 756
     {
752
-        if ($group_id != strval(intval($group_id)))
753
-            return false;
757
+        if ($group_id != strval(intval($group_id))) {
758
+                    return false;
759
+        }
754 760
         $table_message = Database::get_main_table(TABLE_MESSAGE);
755 761
         $group_id = intval($group_id);
756 762
         $sql = "SELECT * FROM $table_message
@@ -828,8 +834,9 @@  discard block
 block discarded – undo
828 834
      */
829 835
     public static function exist_message($user_id, $id)
830 836
     {
831
-        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id)))
832
-            return false;
837
+        if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) {
838
+                    return false;
839
+        }
833 840
         $table_message = Database::get_main_table(TABLE_MESSAGE);
834 841
         $query = "SELECT id FROM $table_message
835 842
                   WHERE
@@ -860,8 +867,9 @@  discard block
 block discarded – undo
860 867
             $direction = 'DESC';
861 868
         } else {
862 869
             $column = intval($column);
863
-            if (!in_array($direction, array('ASC', 'DESC')))
864
-                $direction = 'ASC';
870
+            if (!in_array($direction, array('ASC', 'DESC'))) {
871
+                            $direction = 'ASC';
872
+            }
865 873
         }
866 874
         $table_message = Database::get_main_table(TABLE_MESSAGE);
867 875
         $request = api_is_xml_http_request();
Please login to merge, or discard this patch.