Completed
Push — 1.11.x ( 52cc6f...bf3cbb )
by José
80:28 queued 41:29
created
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.
main/inc/lib/search/search_widget.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@  discard block
 block discarded – undo
48 48
 
49 49
     foreach ($sf_term_array as $raw_term) {
50 50
         $term = substr($raw_term, 1);
51
-        if (empty($term)) continue;
51
+        if (empty($term)) {
52
+            continue;
53
+        }
52 54
         $html_term = htmlspecialchars($term, ENT_QUOTES, $charset);
53 55
         $selected = '';
54 56
         if (!empty($_REQUEST['sf_'.$prefix]) && is_array($_REQUEST['sf_'.$prefix]) && in_array($term,$_REQUEST['sf_'.$prefix])) {
@@ -69,7 +71,9 @@  discard block
 block discarded – undo
69 71
     $max = count($sf_terms);
70 72
     $multiple_selects .='';
71 73
     foreach ($sf_terms as $prefix => $sf_term_array) {
72
-        if ($prefix == $prefilter_prefix) continue;
74
+        if ($prefix == $prefilter_prefix) {
75
+            continue;
76
+        }
73 77
         $multiple_select = '';
74 78
         if ($i>0) {
75 79
             //print "+" image
@@ -342,9 +346,10 @@  discard block
 block discarded – undo
342 346
 
343 347
 	// Tool introduction
344 348
     // TODO: Settings for the online editor to be checked (insert an image for example). Probably this is a special case here.
345
-    if (api_get_course_id() !== -1)
346
-    if (!empty($groupId)) {
349
+    if (api_get_course_id() !== -1) {
350
+        if (!empty($groupId)) {
347 351
         Display::display_introduction_section(TOOL_SEARCH.$groupId);
352
+    }
348 353
     } else {
349 354
         Display::display_introduction_section(TOOL_SEARCH);
350 355
     }
@@ -366,7 +371,9 @@  discard block
 block discarded – undo
366 371
                     break;
367 372
                 }
368 373
             }
369
-            if ($thesaurus_decided) break;
374
+            if ($thesaurus_decided) {
375
+                break;
376
+            }
370 377
         }
371 378
     }
372 379
 
Please login to merge, or discard this patch.
main/inc/lib/search/ChamiloIndexer.class.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@  discard block
 block discarded – undo
36 36
         $stored_terms = $this->get_terms_on_db($prefix, $course_code, $tool_id, $ref_id_high_level);
37 37
 
38 38
         // don't do anything if no change, verify only at DB, not the search engine
39
-        if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0))
40
-            return FALSE;
39
+        if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) {
40
+                    return FALSE;
41
+        }
41 42
 
42 43
         require_once api_get_path(LIBRARY_PATH) . 'search/xapian/XapianQuery.php';
43 44
 
@@ -45,8 +46,9 @@  discard block
 block discarded – undo
45 46
         $doc = $this->get_document($search_did);
46 47
         $xapian_terms = xapian_get_doc_terms($doc, $prefix);
47 48
         $xterms = array();
48
-        foreach ($xapian_terms as $xapian_term)
49
-            $xterms[] = substr($xapian_term['name'], 1);
49
+        foreach ($xapian_terms as $xapian_term) {
50
+                    $xterms[] = substr($xapian_term['name'], 1);
51
+        }
50 52
 
51 53
         $dterms = $terms;
52 54
 
Please login to merge, or discard this patch.
main/inc/lib/baker.lib.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -94,8 +94,9 @@  discard block
 block discarded – undo
94 94
         // Read the magic bytes and verify
95 95
         $retval = substr($png,0,8);
96 96
         $ipos = 8;
97
-        if ($retval != "\x89PNG\x0d\x0a\x1a\x0a")
98
-            throw new Exception('Is not a valid PNG image');
97
+        if ($retval != "\x89PNG\x0d\x0a\x1a\x0a") {
98
+                    throw new Exception('Is not a valid PNG image');
99
+        }
99 100
         // Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type
100 101
         $chunkHeader = substr($png,$ipos,8);
101 102
         $ipos = $ipos + 8;
@@ -107,13 +108,17 @@  discard block
 block discarded – undo
107 108
                 $data = substr($png,$ipos,$chunk['size']);
108 109
                 $sections = explode("\0", $data);
109 110
                 print_r($sections);
110
-                if ( $sections[0] == $key ) $skip = true;
111
+                if ( $sections[0] == $key ) {
112
+                    $skip = true;
113
+                }
111 114
             }
112 115
             // Extract the data and the CRC
113 116
             $data = substr($png,$ipos,$chunk['size']+4);
114 117
             $ipos = $ipos + $chunk['size'] + 4;
115 118
             // Add in the header, data, and CRC
116
-            if ( ! $skip ) $retval = $retval . $chunkHeader . $data;
119
+            if ( ! $skip ) {
120
+                $retval = $retval . $chunkHeader . $data;
121
+            }
117 122
             // Read next chunk header
118 123
             $chunkHeader = substr($png,$ipos,8);
119 124
             $ipos = $ipos + 8;
Please login to merge, or discard this patch.
main/inc/lib/pdf.lib.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -536,8 +536,9 @@
 block discarded – undo
536 536
             }
537 537
         } else {
538 538
             $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
539
-            if (file_exists($store_path))
540
-                $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
539
+            if (file_exists($store_path)) {
540
+                            $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
541
+            }
541 542
         }
542 543
         return $web_path;
543 544
     }
Please login to merge, or discard this patch.
main/inc/lib/myspace.lib.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2097,7 +2097,9 @@
 block discarded – undo
2097 2097
                 FROM $tbl_course course
2098 2098
                 WHERE course.code IN (".implode(',',$courses_code).")";
2099 2099
 
2100
-        if (!in_array($direction, array('ASC','DESC'))) $direction = 'ASC';
2100
+        if (!in_array($direction, array('ASC','DESC'))) {
2101
+            $direction = 'ASC';
2102
+        }
2101 2103
 
2102 2104
         $column = intval($column);
2103 2105
         $from = intval($from);
Please login to merge, or discard this patch.
main/inc/lib/nusoap/class.soapclient.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -173,8 +173,9 @@  discard block
 block discarded – undo
173 173
 		}
174 174
 		if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
175 175
 			$this->loadWSDL();
176
-			if ($this->getError())
177
-				return false;
176
+			if ($this->getError()) {
177
+							return false;
178
+			}
178 179
 		}
179 180
 		// serialize parameters
180 181
 		if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){
@@ -388,8 +389,9 @@  discard block
 block discarded – undo
388 389
 	function getOperationData($operation){
389 390
 		if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
390 391
 			$this->loadWSDL();
391
-			if ($this->getError())
392
-				return false;
392
+			if ($this->getError()) {
393
+							return false;
394
+			}
393 395
 		}
394 396
 		if(isset($this->operations[$operation])){
395 397
 			return $this->operations[$operation];
Please login to merge, or discard this patch.
main/inc/lib/nusoap/class.soap_transport_http.php 1 patch
Braces   +39 added lines, -29 removed lines patch added patch discarded remove patch
@@ -159,10 +159,12 @@  discard block
 block discarded – undo
159 159
 	* @access	private
160 160
 	*/
161 161
 	function io_method() {
162
-		if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm'))
163
-			return 'curl';
164
-		if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm'))
165
-			return 'socket';
162
+		if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) {
163
+					return 'curl';
164
+		}
165
+		if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) {
166
+					return 'socket';
167
+		}
166 168
 		return 'unknown';
167 169
 	}
168 170
 
@@ -246,30 +248,36 @@  discard block
 block discarded – undo
246 248
 			return false;
247 249
 		}
248 250
 		// Avoid warnings when PHP does not have these options
249
-		if (defined('CURLOPT_CONNECTIONTIMEOUT'))
250
-			$CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT;
251
-		else
252
-			$CURLOPT_CONNECTIONTIMEOUT = 78;
253
-		if (defined('CURLOPT_HTTPAUTH'))
254
-			$CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH;
255
-		else
256
-			$CURLOPT_HTTPAUTH = 107;
257
-		if (defined('CURLOPT_PROXYAUTH'))
258
-			$CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH;
259
-		else
260
-			$CURLOPT_PROXYAUTH = 111;
261
-		if (defined('CURLAUTH_BASIC'))
262
-			$CURLAUTH_BASIC = CURLAUTH_BASIC;
263
-		else
264
-			$CURLAUTH_BASIC = 1;
265
-		if (defined('CURLAUTH_DIGEST'))
266
-			$CURLAUTH_DIGEST = CURLAUTH_DIGEST;
267
-		else
268
-			$CURLAUTH_DIGEST = 2;
269
-		if (defined('CURLAUTH_NTLM'))
270
-			$CURLAUTH_NTLM = CURLAUTH_NTLM;
271
-		else
272
-			$CURLAUTH_NTLM = 8;
251
+		if (defined('CURLOPT_CONNECTIONTIMEOUT')) {
252
+					$CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT;
253
+		} else {
254
+					$CURLOPT_CONNECTIONTIMEOUT = 78;
255
+		}
256
+		if (defined('CURLOPT_HTTPAUTH')) {
257
+					$CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH;
258
+		} else {
259
+					$CURLOPT_HTTPAUTH = 107;
260
+		}
261
+		if (defined('CURLOPT_PROXYAUTH')) {
262
+					$CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH;
263
+		} else {
264
+					$CURLOPT_PROXYAUTH = 111;
265
+		}
266
+		if (defined('CURLAUTH_BASIC')) {
267
+					$CURLAUTH_BASIC = CURLAUTH_BASIC;
268
+		} else {
269
+					$CURLAUTH_BASIC = 1;
270
+		}
271
+		if (defined('CURLAUTH_DIGEST')) {
272
+					$CURLAUTH_DIGEST = CURLAUTH_DIGEST;
273
+		} else {
274
+					$CURLAUTH_DIGEST = 2;
275
+		}
276
+		if (defined('CURLAUTH_NTLM')) {
277
+					$CURLAUTH_NTLM = CURLAUTH_NTLM;
278
+		} else {
279
+					$CURLAUTH_NTLM = 8;
280
+		}
273 281
 
274 282
 		$this->debug('connect using cURL');
275 283
 		// init CURL
@@ -612,7 +620,9 @@  discard block
 block discarded – undo
612 620
 								'HTTP/1.0 200 Connection established');
613 621
 		foreach ($skipHeaders as $hd) {
614 622
 			$prefix = substr($data, 0, strlen($hd));
615
-			if ($prefix == $hd) return true;
623
+			if ($prefix == $hd) {
624
+			    return true;
625
+			}
616 626
 		}
617 627
 
618 628
 		return false;
Please login to merge, or discard this patch.