Completed
Push — 1.10.x ( 222be4...5f4aa3 )
by Julito
57:51 queued 09:24
created
main/inc/lib/pear/excelreader/reader.php 1 patch
Braces   +37 added lines, -27 removed lines patch added patch discarded remove patch
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                                                 if ($spos + $len < $limitpos) {
506 506
                                                                 $retstr = substr($this->data, $spos, $len);
507 507
                                                                 $spos += $len;
508
-                                                }else{
508
+                                                } else{
509 509
                                                         // found countinue
510 510
                                                         $retstr = substr($this->data, $spos, $limitpos - $spos);
511 511
                                                         $bytesRead = $limitpos - $spos;
@@ -527,12 +527,12 @@  discard block
 block discarded – undo
527 527
                                                                     $retstr .= substr($this->data, $spos, $len);
528 528
                                                                     $charsLeft -= $len;
529 529
                                                                     $asciiEncoding = true;
530
-                                                                  }elseif (!$asciiEncoding && ($option != 0)){
530
+                                                                  } elseif (!$asciiEncoding && ($option != 0)){
531 531
                                                                                 $len = min($charsLeft * 2, $limitpos - $spos); // min($charsLeft, $conlength);
532 532
                                                                     $retstr .= substr($this->data, $spos, $len);
533 533
                                                                     $charsLeft -= $len/2;
534 534
                                                                     $asciiEncoding = false;
535
-                                                                  }elseif (!$asciiEncoding && ($option == 0)) {
535
+                                                                  } elseif (!$asciiEncoding && ($option == 0)) {
536 536
                                                                 // Bummer - the string starts off as Unicode, but after the
537 537
                                                                 // continuation it is in straightforward ASCII encoding
538 538
                                                                                 $len = min($charsLeft, $limitpos - $spos); // min($charsLeft, $conlength);
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
                                                                 }
542 542
                                                             $charsLeft -= $len;
543 543
                                                                 $asciiEncoding = false;
544
-                                                                  }else{
544
+                                                                  } else{
545 545
                                                             $newstr = '';
546 546
                                                                     for ($j = 0; $j < strlen($retstr); $j++) {
547 547
                                                                       $newstr = $retstr[$j].chr(0);
@@ -619,22 +619,24 @@  discard block
 block discarded – undo
619 619
                                     'type' => 'date',
620 620
                                     'format' => $this->dateFormats[$indexCode]
621 621
                                     );
622
-                        }elseif (array_key_exists($indexCode, $this->numberFormats)) {
622
+                        } elseif (array_key_exists($indexCode, $this->numberFormats)) {
623 623
                         //echo "isnumber ".$this->numberFormats[$indexCode];
624 624
                             $this->formatRecords['xfrecords'][] = array(
625 625
                                     'type' => 'number',
626 626
                                     'format' => $this->numberFormats[$indexCode]
627 627
                                     );
628
-                        }else{
628
+                        } else{
629 629
                             $isdate = FALSE;
630 630
                             if ($indexCode > 0){
631
-                                if (isset($this->formatRecords[$indexCode]))
632
-                                    $formatstr = $this->formatRecords[$indexCode];
631
+                                if (isset($this->formatRecords[$indexCode])) {
632
+                                                                    $formatstr = $this->formatRecords[$indexCode];
633
+                                }
633 634
                                 //echo '.other.';
634 635
                                 //echo "\ndate-time=$formatstr=\n";
635
-                                if ($formatstr)
636
-                                if (preg_match("/[^hmsday\/\-:\s]/i", $formatstr) == 0) { // found day and time format
636
+                                if ($formatstr) {
637
+                                                                if (preg_match("/[^hmsday\/\-:\s]/i", $formatstr) == 0) { // found day and time format
637 638
                                     $isdate = TRUE;
639
+                                }
638 640
                                     $formatstr = str_replace('mm', 'i', $formatstr);
639 641
                                     $formatstr = str_replace('h', 'H', $formatstr);
640 642
                                     //echo "\ndate-time $formatstr \n";
@@ -646,7 +648,7 @@  discard block
 block discarded – undo
646 648
                                         'type' => 'date',
647 649
                                         'format' => $formatstr,
648 650
                                         );
649
-                            }else{
651
+                            } else{
650 652
                                 $this->formatRecords['xfrecords'][] = array(
651 653
                                         'type' => 'other',
652 654
                                         'format' => '',
@@ -674,7 +676,7 @@  discard block
 block discarded – undo
674 676
                             } else {
675 677
                                 $rec_name    = $this->_encodeUTF16(substr($this->data, $pos+12, $rec_length*2));
676 678
                             }
677
-                        }elseif ($version == SPREADSHEET_EXCEL_READER_BIFF7){
679
+                        } elseif ($version == SPREADSHEET_EXCEL_READER_BIFF7){
678 680
                                 $rec_name    = substr($this->data, $pos+11, $rec_length);
679 681
                         }
680 682
                     $this->boundsheets[] = array('name'=>$rec_name,
@@ -733,7 +735,9 @@  discard block
 block discarded – undo
733 735
             //echo "mem= ".memory_get_usage()."\n";
734 736
 //            $r = &$this->file->nextRecord();
735 737
             $lowcode = ord($this->data[$spos]);
736
-            if ($lowcode == SPREADSHEET_EXCEL_READER_TYPE_EOF) break;
738
+            if ($lowcode == SPREADSHEET_EXCEL_READER_TYPE_EOF) {
739
+                break;
740
+            }
737 741
             $code = $lowcode | ord($this->data[$spos+1])<<8;
738 742
             $length = ord($this->data[$spos+2]) | ord($this->data[$spos+3])<<8;
739 743
             $spos += 4;
@@ -783,7 +787,7 @@  discard block
 block discarded – undo
783 787
                     //echo $numValue." ";
784 788
                     if ($this->isDate($spos)) {
785 789
                         list($string, $raw) = $this->createDate($numValue);
786
-                    }else{
790
+                    } else{
787 791
                         $raw = $numValue;
788 792
                         if (isset($this->_columnsFormat[$column + 1])){
789 793
                                 $this->curformat = $this->_columnsFormat[$column + 1];
@@ -813,7 +817,7 @@  discard block
 block discarded – undo
813 817
                         $numValue = $this->_GetIEEE754($this->_GetInt4d($this->data, $tmppos + 2));
814 818
                         if ($this->isDate($tmppos-4)) {
815 819
                             list($string, $raw) = $this->createDate($numValue);
816
-                        }else{
820
+                        } else{
817 821
                             $raw = $numValue;
818 822
                             if (isset($this->_columnsFormat[$colFirst + $i + 1])){
819 823
                                         $this->curformat = $this->_columnsFormat[$colFirst + $i + 1];
@@ -837,7 +841,7 @@  discard block
 block discarded – undo
837 841
                     if ($this->isDate($spos)) {
838 842
                         list($string, $raw) = $this->createDate($tmp['double']);
839 843
                      //   $this->addcell(DateRecord($r, 1));
840
-                    }else{
844
+                    } else{
841 845
                         //$raw = $tmp[''];
842 846
                         if (isset($this->_columnsFormat[$column + 1])){
843 847
                                 $this->curformat = $this->_columnsFormat[$column + 1];
@@ -869,7 +873,7 @@  discard block
 block discarded – undo
869 873
                         if ($this->isDate($spos)) {
870 874
                             list($string, $raw) = $this->createDate($tmp['double']);
871 875
                          //   $this->addcell(DateRecord($r, 1));
872
-                        }else{
876
+                        } else{
873 877
                             //$raw = $tmp[''];
874 878
                             if (isset($this->_columnsFormat[$column + 1])){
875 879
                                     $this->curformat = $this->_columnsFormat[$column + 1];
@@ -913,10 +917,12 @@  discard block
 block discarded – undo
913 917
             $spos += $length;
914 918
         }
915 919
 
916
-        if (!isset($this->sheets[$this->sn]['numRows']))
917
-             $this->sheets[$this->sn]['numRows'] = $this->sheets[$this->sn]['maxrow'];
918
-        if (!isset($this->sheets[$this->sn]['numCols']))
919
-             $this->sheets[$this->sn]['numCols'] = $this->sheets[$this->sn]['maxcol'];
920
+        if (!isset($this->sheets[$this->sn]['numRows'])) {
921
+                     $this->sheets[$this->sn]['numRows'] = $this->sheets[$this->sn]['maxrow'];
922
+        }
923
+        if (!isset($this->sheets[$this->sn]['numCols'])) {
924
+                     $this->sheets[$this->sn]['numCols'] = $this->sheets[$this->sn]['maxcol'];
925
+        }
920 926
 
921 927
     }
922 928
 
@@ -943,7 +949,7 @@  discard block
 block discarded – undo
943 949
                 if (($xfindex == 0x9) || ($xfindex == 0xa)){
944 950
                     $this->multiplier = 100;
945 951
                 }
946
-            }else{
952
+            } else{
947 953
                 $this->curformat = $this->_defaultFormat;
948 954
                 $this->rectype = 'unknown';
949 955
             }
@@ -993,7 +999,9 @@  discard block
 block discarded – undo
993 999
         $mantissalow1 = ($rknumlow & 0x80000000) >> 31;
994 1000
         $mantissalow2 = ($rknumlow & 0x7fffffff);
995 1001
         $value = $mantissa / pow( 2 , (20- ($exp - 1023)));
996
-        if ($mantissalow1 != 0) $value += 1 / pow (2 , (21 - ($exp - 1023)));
1002
+        if ($mantissalow1 != 0) {
1003
+            $value += 1 / pow (2 , (21 - ($exp - 1023)));
1004
+        }
997 1005
         $value += $mantissalow2 / pow (2 , (52 - ($exp - 1023)));
998 1006
         //echo "Sign = $sign, Exp = $exp, mantissahighx = $mantissa, mantissalow1 = $mantissalow1, mantissalow2 = $mantissalow2<br>\n";
999 1007
         if ($sign) {$value = -1 * $value;}
@@ -1006,10 +1014,12 @@  discard block
 block discarded – undo
1006 1014
         $this->sheets[$this->sn]['maxrow'] = max($this->sheets[$this->sn]['maxrow'], $row + $this->_rowoffset);
1007 1015
         $this->sheets[$this->sn]['maxcol'] = max($this->sheets[$this->sn]['maxcol'], $col + $this->_coloffset);
1008 1016
         $this->sheets[$this->sn]['cells'][$row + $this->_rowoffset][$col + $this->_coloffset] = $string;
1009
-        if ($raw)
1010
-            $this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col + $this->_coloffset]['raw'] = $raw;
1011
-        if (isset($this->rectype))
1012
-            $this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col + $this->_coloffset]['type'] = $this->rectype;
1017
+        if ($raw) {
1018
+                    $this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col + $this->_coloffset]['raw'] = $raw;
1019
+        }
1020
+        if (isset($this->rectype)) {
1021
+                    $this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col + $this->_coloffset]['type'] = $this->rectype;
1022
+        }
1013 1023
 
1014 1024
     }
1015 1025
 
Please login to merge, or discard this patch.
main/inc/lib/pear/Exception.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -347,15 +347,22 @@
 block discarded – undo
347 347
             $args = array();
348 348
             if (!empty($v['args'])) {
349 349
                 foreach ($v['args'] as $arg) {
350
-                    if (is_null($arg)) $args[] = 'null';
351
-                    elseif (is_array($arg)) $args[] = 'Array';
352
-                    elseif (is_object($arg)) $args[] = 'Object('.get_class($arg).')';
353
-                    elseif (is_bool($arg)) $args[] = $arg ? 'true' : 'false';
354
-                    elseif (is_int($arg) || is_double($arg)) $args[] = $arg;
355
-                    else {
350
+                    if (is_null($arg)) {
351
+                        $args[] = 'null';
352
+                    } elseif (is_array($arg)) {
353
+                        $args[] = 'Array';
354
+                    } elseif (is_object($arg)) {
355
+                        $args[] = 'Object('.get_class($arg).')';
356
+                    } elseif (is_bool($arg)) {
357
+                        $args[] = $arg ? 'true' : 'false';
358
+                    } elseif (is_int($arg) || is_double($arg)) {
359
+                        $args[] = $arg;
360
+                    } else {
356 361
                         $arg = (string)$arg;
357 362
                         $str = htmlspecialchars(substr($arg, 0, 16));
358
-                        if (strlen($arg) > 16) $str .= '&hellip;';
363
+                        if (strlen($arg) > 16) {
364
+                            $str .= '&hellip;';
365
+                        }
359 366
                         $args[] = "'" . $str . "'";
360 367
                     }
361 368
                 }
Please login to merge, or discard this patch.
main/inc/lib/dashboard.lib.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -380,7 +380,9 @@
 block discarded – undo
380 380
 					// check if user is allowed to see the block
381 381
 					if (method_exists($obj_block, 'is_block_visible_for_user')) {
382 382
 						$is_block_visible_for_user = $obj_block->is_block_visible_for_user($user_id);
383
-						if (!$is_block_visible_for_user) continue;
383
+						if (!$is_block_visible_for_user) {
384
+						    continue;
385
+						}
384 386
 					}
385 387
 
386 388
 					echo '<tr>';
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.
main/inc/lib/nusoap/class.wsdl.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,8 +78,9 @@
 block discarded – undo
78 78
 		$this->proxypassword = $proxypassword;
79 79
 		$this->timeout = $timeout;
80 80
 		$this->response_timeout = $response_timeout;
81
-		if (is_array($curl_options))
82
-			$this->curl_options = $curl_options;
81
+		if (is_array($curl_options)) {
82
+					$this->curl_options = $curl_options;
83
+		}
83 84
 		$this->use_curl = $use_curl;
84 85
 		$this->fetchWSDL($wsdl);
85 86
     }
Please login to merge, or discard this patch.
main/inc/lib/events_dispatcher.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,9 +18,11 @@
 block discarded – undo
18 18
 
19 19
         foreach ($event_config[$event_name]["actions"] as $func) {
20 20
             $execute = true;
21
-            if (!function_exists($func)) // if the function doesn't exist, we log
21
+            if (!function_exists($func)) {
22
+                // if the function doesn't exist, we log
22 23
             {
23 24
                 error_log("EventsDispatcher warning : ".$func." does not exist.");
25
+            }
24 26
                 $execute = false;
25 27
             }
26 28
 
Please login to merge, or discard this patch.
main/inc/lib/glossary.lib.php 1 patch
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -108,8 +108,9 @@  discard block
 block discarded – undo
108 108
         // check if the glossary term already exists
109 109
         if (GlossaryManager::glossary_exists($values['glossary_title'])) {
110 110
             // display the feedback message
111
-            if ($message)
112
-                Display::display_error_message(get_lang('GlossaryTermAlreadyExistsYouShouldEditIt'));
111
+            if ($message) {
112
+                            Display::display_error_message(get_lang('GlossaryTermAlreadyExistsYouShouldEditIt'));
113
+            }
113 114
             return false;
114 115
         } else {
115 116
 
@@ -165,8 +166,9 @@  discard block
 block discarded – undo
165 166
         // check if the glossary term already exists
166 167
         if (GlossaryManager::glossary_exists($values['glossary_title'],$values['glossary_id'])) {
167 168
             // display the feedback message
168
-            if ($message)
169
-                Display::display_error_message(get_lang('GlossaryTermAlreadyExistsYouShouldEditIt'));
169
+            if ($message) {
170
+                            Display::display_error_message(get_lang('GlossaryTermAlreadyExistsYouShouldEditIt'));
171
+            }
170 172
             return false;
171 173
         } else {
172 174
             $sql = "UPDATE $t_glossary SET
@@ -188,8 +190,9 @@  discard block
 block discarded – undo
188 190
                 api_get_user_id()
189 191
             );
190 192
             // display the feedback message
191
-            if ($message)
192
-                Display::display_confirmation_message(get_lang('TermUpdated'));
193
+            if ($message) {
194
+                            Display::display_confirmation_message(get_lang('TermUpdated'));
195
+            }
193 196
         }
194 197
 
195 198
         return true;
@@ -323,8 +326,9 @@  discard block
 block discarded – undo
323 326
         // reorder the remaining terms
324 327
         GlossaryManager::reorder_glossary();
325 328
         $_SESSION['max_glossary_display'] = GlossaryManager::get_max_glossary_item();
326
-        if ($message)
327
-            Display::display_confirmation_message(get_lang('TermDeleted'));
329
+        if ($message) {
330
+                    Display::display_confirmation_message(get_lang('TermDeleted'));
331
+        }
328 332
         return true;
329 333
     }
330 334
 
@@ -633,8 +637,9 @@  discard block
 block discarded – undo
633 637
                  WHERE c_id = $course_id  AND glossary_id = '".Database::escape_string($next_id)."'";
634 638
         Database::query($sql1);
635 639
         Database::query($sql2);
636
-        if ($message)
637
-            Display::display_confirmation_message(get_lang('TermMoved'));
640
+        if ($message) {
641
+                    Display::display_confirmation_message(get_lang('TermMoved'));
642
+        }
638 643
     }
639 644
 
640 645
     /**
Please login to merge, or discard this patch.