Completed
Push — 1.10.x ( 222be4...5f4aa3 )
by Julito
57:51 queued 09:24
created
main/inc/lib/xajax/xajaxCompress.php 1 patch
Braces   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -80,8 +80,7 @@  discard block
 block discarded – undo
80 80
 					$escaped = false;
81 81
 					$quoteChar = $c;
82 82
 					$literal = $c;
83
-				}
84
-				else if($d=="/*" && !$inNormalComment)
83
+				} else if($d=="/*" && !$inNormalComment)
85 84
 				{
86 85
 					$inQuote = false;
87 86
 					$inComment = true;
@@ -89,18 +88,17 @@  discard block
 block discarded – undo
89 88
 					$quoteChar = $d;
90 89
 					$literal = $d;
91 90
 					$j++;
92
-				}
93
-				else if($d=="//") //ignore string markers that are found inside comments
91
+				} else if($d=="//") {
92
+				    //ignore string markers that are found inside comments
94 93
 				{
95 94
 					$inNormalComment = true;
96
-					$clean .= $c;
97 95
 				}
98
-				else
96
+					$clean .= $c;
97
+				} else
99 98
 				{
100 99
 					$clean .= $c;
101 100
 				}
102
-			}
103
-			else //allready in a string so find end quote
101
+			} else //allready in a string so find end quote
104 102
 			{
105 103
 				if($c == $quoteChar && !$escaped && !$inComment)
106 104
 				{
@@ -113,8 +111,7 @@  discard block
 block discarded – undo
113 111
 					//push the string onto our array
114 112
 					array_push($literal_strings,$literal);
115 113
 
116
-				}
117
-				else if($inComment && $d=="*/")
114
+				} else if($inComment && $d=="*/")
118 115
 				{
119 116
 					$inComment = false;
120 117
 					$literal .= $d;
@@ -126,16 +123,18 @@  discard block
 block discarded – undo
126 123
 					array_push($literal_strings,$literal);
127 124
 
128 125
 					$j++;
126
+				} else if($c == "\\" && !$escaped) {
127
+									$escaped = true;
128
+				} else {
129
+									$escaped = false;
129 130
 				}
130
-				else if($c == "\\" && !$escaped)
131
-					$escaped = true;
132
-				else
133
-					$escaped = false;
134 131
 
135 132
 				$literal .= $c;
136 133
 			}
137 134
 		}
138
-		if($inComment) $literal .= "\n";
135
+		if($inComment) {
136
+		    $literal .= "\n";
137
+		}
139 138
 		$clean .= "\n";
140 139
 	}
141 140
 	//explode the clean string into lines again
@@ -174,8 +173,9 @@  discard block
 block discarded – undo
174 173
 	$sJS = preg_replace("/[\n]*\{[\n]*/","{",$sJS);
175 174
 
176 175
 	//finally loop through and replace all the literal strings:
177
-	for($i=0;$i<count($literal_strings);$i++)
178
-		$sJS = str_replace("___".$i."___",$literal_strings[$i],$sJS);
176
+	for($i=0;$i<count($literal_strings);$i++) {
177
+			$sJS = str_replace("___".$i."___",$literal_strings[$i],$sJS);
178
+	}
179 179
 
180 180
 	return $sJS;
181 181
 }
Please login to merge, or discard this patch.
main/inc/lib/userportal.lib.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -338,7 +338,7 @@
 block discarded – undo
338 338
 
339 339
         if (empty($certificatesItem) && empty($searchItem)) {
340 340
             return null;
341
-        }else{
341
+        } else{
342 342
             $content.= $certificatesItem;
343 343
             $content.= $searchItem;
344 344
         }
Please login to merge, or discard this patch.
main/inc/lib/text.lib.php 1 patch
Braces   +31 added lines, -20 removed lines patch added patch discarded remove patch
@@ -351,8 +351,9 @@  discard block
 block discarded – undo
351 351
     }
352 352
 
353 353
     $url = esc_url($url);
354
-    if ( empty($url) )
355
-        return $matches[0];
354
+    if ( empty($url) ) {
355
+            return $matches[0];
356
+    }
356 357
 
357 358
     return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" . $suffix;
358 359
 }
@@ -377,8 +378,9 @@  discard block
 block discarded – undo
377 378
 function esc_url( $url, $protocols = null, $_context = 'display' ) {
378 379
     //$original_url = $url;
379 380
 
380
-    if ( '' == $url )
381
-        return $url;
381
+    if ( '' == $url ) {
382
+            return $url;
383
+    }
382 384
     $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
383 385
     $strip = array('%0d', '%0a', '%0D', '%0A');
384 386
     $url = _deep_replace($strip, $url);
@@ -388,8 +390,9 @@  discard block
 block discarded – undo
388 390
      * link starting with /, # or ? or a php file).
389 391
      */
390 392
     if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
391
-        ! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
392
-        $url = 'http://' . $url;
393
+        ! preg_match('/^[a-z0-9-]+?\.php/i', $url) ) {
394
+            $url = 'http://' . $url;
395
+    }
393 396
 
394 397
     return Security::remove_XSS($url);
395 398
 
@@ -466,8 +469,9 @@  discard block
 block discarded – undo
466 469
     $dest = $matches[2];
467 470
     $dest = 'http://' . $dest;
468 471
     $dest = esc_url($dest);
469
-    if ( empty($dest) )
470
-        return $matches[0];
472
+    if ( empty($dest) ) {
473
+            return $matches[0];
474
+    }
471 475
 
472 476
     // removed trailing [.,;:)] from URL
473 477
     if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
@@ -511,10 +515,11 @@  discard block
 block discarded – undo
511 515
     $nested_code_pre = 0; // Keep track of how many levels link is nested inside <pre> or <code>
512 516
     foreach ( $textarr as $piece ) {
513 517
 
514
-        if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) )
515
-            $nested_code_pre++;
516
-        elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre )
517
-            $nested_code_pre--;
518
+        if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) ) {
519
+                    $nested_code_pre++;
520
+        } elseif ( ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) ) && $nested_code_pre ) {
521
+                    $nested_code_pre--;
522
+        }
518 523
 
519 524
         if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {
520 525
             $r .= $piece;
@@ -723,15 +728,13 @@  discard block
 block discarded – undo
723 728
 			if($length>$maxchar)
724 729
 			{
725 730
 				break;
726
-			}
727
-			else
731
+			} else
728 732
 			{
729 733
 				$output = $output." ".$words[$i];
730 734
 				$i++;
731 735
 			};
732 736
 		};
733
-	}
734
-	else
737
+	} else
735 738
 	{
736 739
 		$output = $text;
737 740
 		return $output;
@@ -782,13 +785,21 @@  discard block
 block discarded – undo
782 785
     if (isset($array['Y']) && (isset($array['F']) || isset($array['M']))  && isset($array['d']) && isset($array['H']) && isset($array['i'])) {
783 786
         $year = $array['Y'];
784 787
         $month = isset($array['F'])?$array['F']:$array['M'];
785
-        if (intval($month) < 10 ) $month = '0'.$month;
788
+        if (intval($month) < 10 ) {
789
+            $month = '0'.$month;
790
+        }
786 791
         $day = $array['d'];
787
-        if (intval($day) < 10 ) $day = '0'.$day;
792
+        if (intval($day) < 10 ) {
793
+            $day = '0'.$day;
794
+        }
788 795
         $hours = $array['H'];
789
-        if (intval($hours) < 10 ) $hours = '0'.$hours;
796
+        if (intval($hours) < 10 ) {
797
+            $hours = '0'.$hours;
798
+        }
790 799
         $minutes = $array['i'];
791
-        if (intval($minutes) < 10 ) $minutes = '0'.$minutes;
800
+        if (intval($minutes) < 10 ) {
801
+            $minutes = '0'.$minutes;
802
+        }
792 803
     }
793 804
     if (checkdate($month,$day,$year)) {
794 805
         $datetime = $year.'-'.$month.'-'.$day.' '.$hours.':'.$minutes.':'.$seconds;
Please login to merge, or discard this patch.
main/tracking/lp_results_by_user.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,8 +73,9 @@
 block discarded – undo
73 73
 //$form->addElement('submit','submit',get_lang('Filter'));
74 74
 $form->addButtonFilter(get_lang('Filter'));
75 75
 
76
-if (!empty($_REQUEST['course_code']))
76
+if (!empty($_REQUEST['course_code'])) {
77 77
     $selected_course = $_REQUEST['course_code'];
78
+}
78 79
 if (!empty($selected_course)) {
79 80
     $selected_course = api_get_course_info($selected_course);
80 81
     $course_list = array($selected_course);
Please login to merge, or discard this patch.
main/tracking/toolaccess_details.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -90,7 +90,9 @@  discard block
 block discarded – undo
90 90
             echo "<tr>
91 91
                     <td>
92 92
                     ";
93
-            if(isset($_cid)) echo "<b>$_cid : </b>";
93
+            if(isset($_cid)) {
94
+                echo "<b>$_cid : </b>";
95
+            }
94 96
             echo "		<b>".get_lang('ToolList')."</b>
95 97
 					</td>
96 98
                 </tr>
@@ -116,27 +118,28 @@  discard block
 block discarded – undo
116 118
                         echo"</tr>";
117 119
                 }
118 120
 
119
-            }
120
-            else
121
+            } else
121 122
             {
122 123
                 echo "<tr>";
123 124
                 echo "<td colspan='2'><center>".get_lang('NoResult')."</center></td>";
124 125
                 echo"</tr>";
125 126
             }
126 127
             echo "</table></td></tr>";
127
-        }
128
-        else
128
+        } else
129 129
         {
130 130
             // this can prevent bug if there is special chars in $tool
131 131
             $encodedTool = urlencode($tool);
132 132
             $tool = urldecode($tool);
133 133
 
134
-            if( !isset($reqdate) )
135
-                $reqdate = time();
134
+            if( !isset($reqdate) ) {
135
+                            $reqdate = time();
136
+            }
136 137
             echo "<tr>
137 138
                     <td>
138 139
 					";
139
-            if(isset($_cid)) echo "<b>$_cid : </b>";
140
+            if(isset($_cid)) {
141
+                echo "<b>$_cid : </b>";
142
+            }
140 143
             echo "        <b>".get_lang($tool)."</b>
141 144
 					</td>
142 145
                 </tr>
Please login to merge, or discard this patch.
main/tracking/logins_details.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -182,10 +182,11 @@
 block discarded – undo
182 182
                 echo "<td style='padding-left : 40px;' valign='top'>" . $beautifulDateTime . "</td>";
183 183
                 echo"</tr>";
184 184
                 // $limit is used to select only results between $results[$j] (current login) and next one
185
-                if ($j == ( sizeof($results) - 1 ))
186
-                    $limit = date("Y-m-d H:i:s", $nextReqDate);
187
-                else
188
-                    $limit = $results[$j + 1];
185
+                if ($j == ( sizeof($results) - 1 )) {
186
+                                    $limit = date("Y-m-d H:i:s", $nextReqDate);
187
+                } else {
188
+                                    $limit = $results[$j + 1];
189
+                }
189 190
                 // select all access to tool between displayed date and next displayed date or now() if
190 191
                 // displayed date is the last login date
191 192
                 $sql = "SELECT access_tool, count(access_tool)
Please login to merge, or discard this patch.
main/tracking/courseLogCSV.php 1 patch
Braces   +17 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,20 +38,27 @@  discard block
 block discarded – undo
38 38
 
39 39
 $view = $_REQUEST['view'];
40 40
 
41
-if ($view == "0000001")
41
+if ($view == "0000001") {
42 42
     $nameTools = get_lang('SynthesisView');
43
-if ($view == "1000000")
43
+}
44
+if ($view == "1000000") {
44 45
     $nameTools = get_lang('CourseStats');
45
-if ($view == "0100000")
46
+}
47
+if ($view == "0100000") {
46 48
     $nameTools = get_lang('CourseAccess');
47
-if ($view == "0010000")
49
+}
50
+if ($view == "0010000") {
48 51
     $nameTools = get_lang('ToolsAccess');
49
-if ($view == "0001000")
52
+}
53
+if ($view == "0001000") {
50 54
     $nameTools = get_lang('LinksAccess');
51
-if ($view == "0000100")
55
+}
56
+if ($view == "0000100") {
52 57
     $nameTools = get_lang('DocumentsAccess');
53
-if ($view == "00000010")
58
+}
59
+if ($view == "00000010") {
54 60
     $nameTools = get_lang('ScormAccess');
61
+}
55 62
 
56 63
 $interbreadcrumb[] = array("url" => api_get_self() . "?view=0000000", "name" => get_lang('ToolName'));
57 64
 
@@ -79,8 +86,9 @@  discard block
 block discarded – undo
79 86
       </div><br>
80 87
       "; */
81 88
 
82
-    if (!isset($view))
83
-        $view = "0000000";
89
+    if (!isset($view)) {
90
+            $view = "0000000";
91
+    }
84 92
 
85 93
 
86 94
     /* 	Reporting */
Please login to merge, or discard this patch.
main/tracking/course_session_report.php 1 patch
Braces   +10 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,8 +47,16 @@
 block discarded – undo
47 47
 $form->addElement('select', 'session_id', get_lang('Sessions'), $my_session_list);
48 48
 $form->addButtonFilter(get_lang('Filter'));
49 49
 
50
-if (!empty($_REQUEST['score']))	$filter_score = intval($_REQUEST['score']); else $filter_score = 70;
51
-if (!empty($_REQUEST['session_id'])) $session_id = intval($_REQUEST['session_id']); else $session_id = 0;
50
+if (!empty($_REQUEST['score'])) {
51
+    $filter_score = intval($_REQUEST['score']);
52
+} else {
53
+    $filter_score = 70;
54
+}
55
+if (!empty($_REQUEST['session_id'])) {
56
+    $session_id = intval($_REQUEST['session_id']);
57
+} else {
58
+    $session_id = 0;
59
+}
52 60
 
53 61
 if (empty($session_id)) {
54 62
 	$session_id = key($my_session_list);
Please login to merge, or discard this patch.
main/tracking/course_access_details.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,9 @@
 block discarded – undo
57 57
 <table width="100%" cellpadding="2" cellspacing="3" border="0">
58 58
 <?php
59 59
     if ($is_allowedToTrack) {
60
-        if (!isset($reqdate) || $reqdate < 0 || $reqdate > 2149372861)
61
-            $reqdate = time();
60
+        if (!isset($reqdate) || $reqdate < 0 || $reqdate > 2149372861) {
61
+                    $reqdate = time();
62
+        }
62 63
             //** dislayed period
63 64
             echo "<tr><td><b>";
64 65
             switch($period) {
Please login to merge, or discard this patch.