Passed
Push — master ( 678db7...164b32 )
by Cody
06:12 queued 03:06
created
classes/labels.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,12 +176,16 @@
 block discarded – undo
176 176
 
177 177
 		}
178 178
 
179
-		if (!$tr_in_progress) $pdo->commit();
179
+		if (!$tr_in_progress) {
180
+		    $pdo->commit();
181
+		}
180 182
 	}
181 183
 
182 184
 	public static function create($caption, $fg_color = '', $bg_color = '', $owner_uid = false) {
183 185
 
184
-		if (!$owner_uid) $owner_uid = $_SESSION['uid'];
186
+		if (!$owner_uid) {
187
+		    $owner_uid = $_SESSION['uid'];
188
+		}
185 189
 
186 190
 		$pdo = Db::pdo();
187 191
 
Please login to merge, or discard this patch.
classes/api.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,11 +192,15 @@
 block discarded – undo
192 192
 		$feed_id = clean($_REQUEST["feed_id"]);
193 193
 		if ($feed_id !== "") {
194 194
 
195
-			if (is_numeric($feed_id)) $feed_id = (int) $feed_id;
195
+			if (is_numeric($feed_id)) {
196
+			    $feed_id = (int) $feed_id;
197
+			}
196 198
 
197 199
 			$limit = (int) clean($_REQUEST["limit"]);
198 200
 
199
-			if (!$limit || $limit >= 200) $limit = 200;
201
+			if (!$limit || $limit >= 200) {
202
+			    $limit = 200;
203
+			}
200 204
 
201 205
 			$offset = (int) clean($_REQUEST["skip"]);
202 206
 			$filter = clean($_REQUEST["filter"]);
Please login to merge, or discard this patch.
include/colors.php 1 patch
Braces   +19 added lines, -15 removed lines patch added patch discarded remove patch
@@ -262,12 +262,20 @@  discard block
 block discarded – undo
262 262
         $del_G = ((($var_Max - $var_G) / 6) + ($del_Max / 2)) / $del_Max;
263 263
         $del_B = ((($var_Max - $var_B) / 6) + ($del_Max / 2)) / $del_Max;
264 264
 
265
-        if ($var_R == $var_Max) $h = $del_B - $del_G;
266
-        else if ($var_G == $var_Max) $h = (1 / 3) + $del_R - $del_B;
267
-        else if ($var_B == $var_Max) $h = (2 / 3) + $del_G - $del_R;
265
+        if ($var_R == $var_Max) {
266
+            $h = $del_B - $del_G;
267
+        } else if ($var_G == $var_Max) {
268
+            $h = (1 / 3) + $del_R - $del_B;
269
+        } else if ($var_B == $var_Max) {
270
+            $h = (2 / 3) + $del_G - $del_R;
271
+        }
268 272
 
269
-        if ($h < 0) $h++;
270
-        if ($h > 1) $h--;
273
+        if ($h < 0) {
274
+            $h++;
275
+        }
276
+        if ($h > 1) {
277
+            $h--;
278
+        }
271 279
     }
272 280
 
273 281
     return array($h, $s, $v);
@@ -287,12 +295,7 @@  discard block
 block discarded – undo
287 295
         $var_2 = $v * (1 - $s * ($var_H - $var_i));
288 296
         $var_3 = $v * (1 - $s * (1 - ($var_H - $var_i)));
289 297
 
290
-        if ($var_i == 0) { $var_R = $v; $var_G = $var_3; $var_B = $var_1; }
291
-        else if ($var_i == 1) { $var_R = $var_2; $var_G = $v; $var_B = $var_1; }
292
-        else if ($var_i == 2) { $var_R = $var_1; $var_G = $v; $var_B = $var_3; }
293
-        else if ($var_i == 3) { $var_R = $var_1; $var_G = $var_2; $var_B = $v; }
294
-        else if ($var_i == 4) { $var_R = $var_3; $var_G = $var_1; $var_B = $v; }
295
-        else { $var_R = $v; $var_G = $var_1; $var_B = $var_2; }
298
+        if ($var_i == 0) { $var_R = $v; $var_G = $var_3; $var_B = $var_1; } else if ($var_i == 1) { $var_R = $var_2; $var_G = $v; $var_B = $var_1; } else if ($var_i == 2) { $var_R = $var_1; $var_G = $v; $var_B = $var_3; } else if ($var_i == 3) { $var_R = $var_1; $var_G = $var_2; $var_B = $v; } else if ($var_i == 4) { $var_R = $var_3; $var_G = $var_1; $var_B = $v; } else { $var_R = $v; $var_G = $var_1; $var_B = $var_2; }
296 299
 
297 300
         $r = $var_R * 255;
298 301
         $g = $var_G * 255;
@@ -315,10 +318,11 @@  discard block
 block discarded – undo
315 318
             $ico = new floIcon();
316 319
             @$ico->readICO($imageFile);
317 320
 
318
-            if (count($ico->images) == 0)
319
-                return false;
320
-            else
321
-                $img = @$ico->images[count($ico->images) - 1]->getImageResource();
321
+            if (count($ico->images) == 0) {
322
+                            return false;
323
+            } else {
324
+                            $img = @$ico->images[count($ico->images) - 1]->getImageResource();
325
+            }
322 326
 
323 327
         } else {
324 328
             return false;
Please login to merge, or discard this patch.
lib/jimIcon.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@
 block discarded – undo
67 67
                 $most_pixels = 0;
68 68
                 for ($i = 0; $i < $h["num"]; $i++) {
69 69
                         $entry = substr($ico, 6 + 16 * $i, 16);
70
-                        if (!$entry || strlen($entry) < 16)
71
-                                continue;
70
+                        if (!$entry || strlen($entry) < 16) {
71
+                                                        continue;
72
+                        }
72 73
                         $e = unpack("Cwidth/".
73 74
                                     "Cheight/".
74 75
                                     "Ccolors/".
Please login to merge, or discard this patch.
lib/MiniTemplator.class.php 1 patch
Braces   +144 added lines, -71 removed lines patch added patch discarded remove patch
@@ -282,16 +282,22 @@  discard block
 block discarded – undo
282 282
    $p = 0;
283 283
    while (true) {
284 284
       $p0 = strpos($this->template, '<!--', $p);
285
-      if ($p0 === false) break;
285
+      if ($p0 === false) {
286
+          break;
287
+      }
286 288
       $p = strpos($this->template, '-->', $p0);
287 289
       if ($p === false) {
288 290
          $this->triggerError("Invalid HTML comment in template at offset $p0.");
289 291
          return false; }
290 292
       $p += 3;
291 293
       $cmdL = substr($this->template, $p0 + 4, $p - $p0 - 7);
292
-      if (!$this->processTemplateCommand($cmdL, $p0, $p, $resumeFromStart))
293
-         return false;
294
-      if ($resumeFromStart) $p = $p0; }
294
+      if (!$this->processTemplateCommand($cmdL, $p0, $p, $resumeFromStart)) {
295
+               return false;
296
+      }
297
+      if ($resumeFromStart) {
298
+          $p = $p0;
299
+      }
300
+      }
295 301
    return true; }
296 302
 
297 303
 /**
@@ -302,20 +308,25 @@  discard block
 block discarded – undo
302 308
    $resumeFromStart = false;
303 309
    $p = 0;
304 310
    $cmd = '';
305
-   if (!$this->parseWord($cmdL, $p, $cmd)) return true;
311
+   if (!$this->parseWord($cmdL, $p, $cmd)) {
312
+       return true;
313
+   }
306 314
    $parms = substr($cmdL, $p);
307 315
    switch (strtoupper($cmd)) {
308 316
       case '$BEGINBLOCK':
309
-         if (!$this->processBeginBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
310
-            return false;
317
+         if (!$this->processBeginBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd)) {
318
+                     return false;
319
+         }
311 320
          break;
312 321
       case '$ENDBLOCK':
313
-         if (!$this->processEndBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
314
-            return false;
322
+         if (!$this->processEndBlockCmd($parms, $cmdTPosBegin, $cmdTPosEnd)) {
323
+                     return false;
324
+         }
315 325
          break;
316 326
       case '$INCLUDE':
317
-         if (!$this->processincludeCmd($parms, $cmdTPosBegin, $cmdTPosEnd))
318
-            return false;
327
+         if (!$this->processincludeCmd($parms, $cmdTPosBegin, $cmdTPosEnd)) {
328
+                     return false;
329
+         }
319 330
          $resumeFromStart = true;
320 331
          break;
321 332
       default:
@@ -387,8 +398,9 @@  discard block
 block discarded – undo
387 398
    $btr = & $this->blockTab[$blockNo];
388 399
    $btr = array();
389 400
    $btr['blockName'] = $blockName;
390
-   if (!$this->lookupBlockName($blockName, $btr['nextWithSameName']))
391
-      $btr['nextWithSameName'] = -1;
401
+   if (!$this->lookupBlockName($blockName, $btr['nextWithSameName'])) {
402
+         $btr['nextWithSameName'] = -1;
403
+   }
392 404
    $btr['definitionIsOpen'] = true;
393 405
    $btr['instances'] = 0;
394 406
    $btr['firstBlockInstNo'] = -1;
@@ -438,7 +450,9 @@  discard block
 block discarded – undo
438 450
    if (strlen($this->template) > $this->maxInclTemplateSize) {
439 451
       $this->triggerError("Subtemplate include aborted because the internal template string is longer than $this->maxInclTemplateSize characters.");
440 452
       return false; }
441
-   if (!$this->loadSubtemplate($subtemplateName, $subtemplate)) return false;
453
+   if (!$this->loadSubtemplate($subtemplateName, $subtemplate)) {
454
+       return false;
455
+   }
442 456
    // (Copying the template to insert a subtemplate is a bit slow. In a future implementation of MiniTemplator,
443 457
    // a table could be used that contains references to the string fragments.)
444 458
    $this->template = substr($this->template, 0, $tPos1).$subtemplate.substr($this->template, $tPos2);
@@ -473,8 +487,9 @@  discard block
 block discarded – undo
473 487
 * @access private
474 488
 */
475 489
 function registerVariableReference($varName, $tPosBegin, $tPosEnd) {
476
-   if (!$this->lookupVariableName($varName, $varNo))
477
-      $this->registerVariable($varName, $varNo);
490
+   if (!$this->lookupVariableName($varName, $varNo)) {
491
+         $this->registerVariable($varName, $varNo);
492
+   }
478 493
    $varRefNo = $this->varRefTabCnt++;
479 494
    $vrtr = & $this->varRefTab[$varRefNo];
480 495
    $vrtr = array();
@@ -514,12 +529,14 @@  discard block
 block discarded – undo
514 529
             $nextBlockNo += 1;
515 530
             continue; }}
516 531
       $btr = & $this->blockTab[$activeBlockNo];
517
-      if ($varRefTPos < $btr['tPosBegin'])
518
-         $this->programLogicError(1);
532
+      if ($varRefTPos < $btr['tPosBegin']) {
533
+               $this->programLogicError(1);
534
+      }
519 535
       $blockVarNo = $btr['blockVarCnt']++;
520 536
       $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;
521
-      if ($btr['firstVarRefNo'] == -1)
522
-         $btr['firstVarRefNo'] = $varRefNo;
537
+      if ($btr['firstVarRefNo'] == -1) {
538
+               $btr['firstVarRefNo'] = $varRefNo;
539
+      }
523 540
       $vrtr['blockNo'] = $activeBlockNo;
524 541
       $vrtr['blockVarNo'] = $blockVarNo;
525 542
       $varRefNo += 1; }}
@@ -535,8 +552,9 @@  discard block
 block discarded – undo
535 552
 * @access public
536 553
 */
537 554
 function reset() {
538
-   for ($varNo = 0; $varNo < $this->varTabCnt; $varNo++)
539
-      $this->varTab[$varNo]['varValue'] = '';
555
+   for ($varNo = 0; $varNo < $this->varTabCnt; $varNo++) {
556
+         $this->varTab[$varNo]['varValue'] = '';
557
+   }
540 558
    for ($blockNo = 0; $blockNo < $this->blockTabCnt; $blockNo++) {
541 559
       $btr = & $this->blockTab[$blockNo];
542 560
       $btr['instances'] = 0;
@@ -563,7 +581,9 @@  discard block
 block discarded – undo
563 581
 function setVariable($variableName, $variableValue, $isOptional = false) {
564 582
    if (!$this->templateValid) {$this->triggerError("Template not valid."); return false; }
565 583
    if (!$this->lookupVariableName($variableName, $varNo)) {
566
-      if ($isOptional) return true;
584
+      if ($isOptional) {
585
+          return true;
586
+      }
567 587
       $this->triggerError("Variable \"$variableName\" not defined in template.");
568 588
       return false; }
569 589
    $this->varTab[$varNo]['varValue'] = $variableValue;
@@ -631,20 +651,23 @@  discard block
 block discarded – undo
631 651
    $btr = & $this->blockTab[$blockNo];
632 652
    $this->registerBlockInstance($blockInstNo);
633 653
    $bitr = & $this->blockInstTab[$blockInstNo];
634
-   if ($btr['firstBlockInstNo'] == -1)
635
-      $btr['firstBlockInstNo'] = $blockInstNo;
636
-   if ($btr['lastBlockInstNo'] != -1)
637
-      $this->blockInstTab[$btr['lastBlockInstNo']]['nextBlockInstNo'] = $blockInstNo;
654
+   if ($btr['firstBlockInstNo'] == -1) {
655
+         $btr['firstBlockInstNo'] = $blockInstNo;
656
+   }
657
+   if ($btr['lastBlockInstNo'] != -1) {
658
+         $this->blockInstTab[$btr['lastBlockInstNo']]['nextBlockInstNo'] = $blockInstNo;
659
+   }
638 660
          // set forward pointer of chain
639 661
    $btr['lastBlockInstNo'] = $blockInstNo;
640 662
    $parentBlockNo = $btr['parentBlockNo'];
641 663
    $blockVarCnt = $btr['blockVarCnt'];
642 664
    $bitr['blockNo'] = $blockNo;
643 665
    $bitr['instanceLevel'] = $btr['instances']++;
644
-   if ($parentBlockNo == -1)
645
-      $bitr['parentInstLevel'] = -1;
646
-    else
647
-      $bitr['parentInstLevel'] = $this->blockTab[$parentBlockNo]['instances'];
666
+   if ($parentBlockNo == -1) {
667
+         $bitr['parentInstLevel'] = -1;
668
+   } else {
669
+          $bitr['parentInstLevel'] = $this->blockTab[$parentBlockNo]['instances'];
670
+    }
648 671
    $bitr['nextBlockInstNo'] = -1;
649 672
    $bitr['blockVarTab'] = array();
650 673
    // copy instance variables for this block
@@ -691,7 +714,9 @@  discard block
 block discarded – undo
691 714
 */
692 715
 function generateOutputToFile($fileName) {
693 716
    $fh = fopen($fileName, "wb");
694
-   if ($fh === false) return false;
717
+   if ($fh === false) {
718
+       return false;
719
+   }
695 720
    $this->outputMode = 1;
696 721
    $this->outputFileHandle = $fh;
697 722
    $ok = $this->generateOutputPage();
@@ -721,14 +746,18 @@  discard block
 block discarded – undo
721 746
 */
722 747
 function generateOutputPage() {
723 748
    if (!$this->templateValid) {$this->triggerError("Template not valid."); return false; }
724
-   if ($this->blockTab[0]['instances'] == 0)
725
-      $this->addBlockByNo(0); // add main block
749
+   if ($this->blockTab[0]['instances'] == 0) {
750
+         $this->addBlockByNo(0);
751
+   }
752
+   // add main block
726 753
    for ($blockNo = 0; $blockNo < $this->blockTabCnt; $blockNo++) {
727 754
        $btr = & $this->blockTab[$blockNo];
728 755
        $btr['currBlockInstNo'] = $btr['firstBlockInstNo']; }
729 756
    $this->outputError = false;
730 757
    $this->writeBlockInstances(0, -1);
731
-   if ($this->outputError) return false;
758
+   if ($this->outputError) {
759
+       return false;
760
+   }
732 761
    return true; }
733 762
 
734 763
 /**
@@ -741,11 +770,16 @@  discard block
 block discarded – undo
741 770
    $btr = & $this->blockTab[$blockNo];
742 771
    while (!$this->outputError) {
743 772
       $blockInstNo = $btr['currBlockInstNo'];
744
-      if ($blockInstNo == -1) break;
773
+      if ($blockInstNo == -1) {
774
+          break;
775
+      }
745 776
       $bitr = & $this->blockInstTab[$blockInstNo];
746
-      if ($bitr['parentInstLevel'] < $parentInstLevel)
747
-         $this->programLogicError(2);
748
-      if ($bitr['parentInstLevel'] > $parentInstLevel) break;
777
+      if ($bitr['parentInstLevel'] < $parentInstLevel) {
778
+               $this->programLogicError(2);
779
+      }
780
+      if ($bitr['parentInstLevel'] > $parentInstLevel) {
781
+          break;
782
+      }
749 783
       $this->writeBlockInstance($blockInstNo);
750 784
       $btr['currBlockInstNo'] = $bitr['nextBlockInstNo']; }}
751 785
 
@@ -778,15 +812,17 @@  discard block
 block discarded – undo
778 812
          if ($subBtr['tPosBegin'] < $tPos2) {
779 813
             $tPos2 = $subBtr['tPosBegin'];
780 814
             $kind = 2; }}
781
-      if ($tPos2 > $tPos)
782
-         $this->writeString(substr($this->template, $tPos, $tPos2 - $tPos));
815
+      if ($tPos2 > $tPos) {
816
+               $this->writeString(substr($this->template, $tPos, $tPos2 - $tPos));
817
+      }
783 818
       switch ($kind) {
784 819
          case 0:         // end of block
785 820
             return;
786 821
          case 1:         // variable
787 822
             $vrtr = & $this->varRefTab[$varRefNo];
788
-            if ($vrtr['blockNo'] != $blockNo)
789
-               $this->programLogicError(4);
823
+            if ($vrtr['blockNo'] != $blockNo) {
824
+                           $this->programLogicError(4);
825
+            }
790 826
             $variableValue = $bitr['blockVarTab'][$vrtr['blockVarNo']];
791 827
             $this->writeString($variableValue);
792 828
             $tPos = $vrtr['tPosEnd'];
@@ -794,8 +830,9 @@  discard block
 block discarded – undo
794 830
             break;
795 831
          case 2:         // sub block
796 832
             $subBtr = & $this->blockTab[$subBlockNo];
797
-            if ($subBtr['parentBlockNo'] != $blockNo)
798
-               $this->programLogicError(3);
833
+            if ($subBtr['parentBlockNo'] != $blockNo) {
834
+                           $this->programLogicError(3);
835
+            }
799 836
             $this->writeBlockInstances($subBlockNo, $bitr['instanceLevel']); // recursive call
800 837
             $tPos = $subBtr['tPosEnd'];
801 838
             $subBlockNo += 1;
@@ -805,15 +842,20 @@  discard block
 block discarded – undo
805 842
 * @access private
806 843
 */
807 844
 function writeString($s) {
808
-   if ($this->outputError) return;
845
+   if ($this->outputError) {
846
+       return;
847
+   }
809 848
    switch ($this->outputMode) {
810 849
       case 0:            // output to PHP output stream
811
-         if (!print($s))
812
-            $this->outputError = true;
850
+         if (!print($s)) {
851
+                     $this->outputError = true;
852
+         }
813 853
          break;
814 854
       case 1:            // output to file
815 855
          $rc = fwrite($this->outputFileHandle, $s);
816
-         if ($rc === false) $this->outputError = true;
856
+         if ($rc === false) {
857
+             $this->outputError = true;
858
+         }
817 859
          break;
818 860
       case 2:            // output to string
819 861
          $this->outputString .= $s;
@@ -828,7 +870,9 @@  discard block
 block discarded – undo
828 870
 */
829 871
 function lookupVariableName($varName, &$varNo) {
830 872
    $x = & $this->varNameToNoMap[strtoupper($varName)];
831
-   if (!isset($x)) return false;
873
+   if (!isset($x)) {
874
+       return false;
875
+   }
832 876
    $varNo = $x;
833 877
    return true; }
834 878
 
@@ -841,7 +885,9 @@  discard block
 block discarded – undo
841 885
 */
842 886
 function lookupBlockName($blockName, &$blockNo) {
843 887
    $x = & $this->blockNameToNoMap[strtoupper($blockName)];
844
-   if (!isset($x)) return false;
888
+   if (!isset($x)) {
889
+       return false;
890
+   }
845 891
    $blockNo = $x;
846 892
    return true; }
847 893
 
@@ -855,15 +901,21 @@  discard block
 block discarded – undo
855 901
 function readFileIntoString($fileName, &$s) {
856 902
    if (function_exists('version_compare') && version_compare(phpversion(), "4.3.0", ">=")) {
857 903
       $s = file_get_contents($fileName);
858
-      if ($s === false) return false;
904
+      if ($s === false) {
905
+          return false;
906
+      }
859 907
       return true; }
860 908
    $fh = fopen($fileName, "rb");
861
-   if ($fh === false) return false;
909
+   if ($fh === false) {
910
+       return false;
911
+   }
862 912
    $fileSize = filesize($fileName);
863 913
    if ($fileSize === false) {fclose($fh); return false; }
864 914
    $s = fread($fh, $fileSize);
865 915
    fclose($fh);
866
-   if (strlen($s) != $fileSize) return false;
916
+   if (strlen($s) != $fileSize) {
917
+       return false;
918
+   }
867 919
    return true; }
868 920
 
869 921
 /**
@@ -891,12 +943,22 @@  discard block
 block discarded – undo
891 943
 */
892 944
 function parseQuotedString($s, &$p, &$w) {
893 945
    $sLen = strlen($s);
894
-   while ($p < $sLen && ord($s{$p}) <= 32) $p++;
895
-   if ($p >= $sLen) return false;
896
-   if (substr($s, $p, 1) != '"') return false;
946
+   while ($p < $sLen && ord($s{$p}) <= 32) {
947
+       $p++;
948
+   }
949
+   if ($p >= $sLen) {
950
+       return false;
951
+   }
952
+   if (substr($s, $p, 1) != '"') {
953
+       return false;
954
+   }
897 955
    $p++; $p0 = $p;
898
-   while ($p < $sLen && $s{$p} != '"') $p++;
899
-   if ($p >= $sLen) return false;
956
+   while ($p < $sLen && $s{$p} != '"') {
957
+       $p++;
958
+   }
959
+   if ($p >= $sLen) {
960
+       return false;
961
+   }
900 962
    $w = substr($s, $p0, $p - $p0);
901 963
    $p++;
902 964
    return true; }
@@ -907,25 +969,36 @@  discard block
 block discarded – undo
907 969
 */
908 970
 function parseWordOrQuotedString($s, &$p, &$w) {
909 971
    $sLen = strlen($s);
910
-   while ($p < $sLen && ord($s{$p}) <= 32) $p++;
911
-   if ($p >= $sLen) return false;
912
-   if (substr($s, $p, 1) == '"')
913
-      return $this->parseQuotedString($s, $p, $w);
914
-    else
915
-      return $this->parseWord($s, $p, $w); }
972
+   while ($p < $sLen && ord($s{$p}) <= 32) {
973
+       $p++;
974
+   }
975
+   if ($p >= $sLen) {
976
+       return false;
977
+   }
978
+   if (substr($s, $p, 1) == '"') {
979
+         return $this->parseQuotedString($s, $p, $w);
980
+   } else {
981
+          return $this->parseWord($s, $p, $w);
982
+    }
983
+    }
916 984
 
917 985
 /**
918 986
 * Combine two file system paths.
919 987
 * @access private
920 988
 */
921 989
 function combineFileSystemPath($path1, $path2) {
922
-   if ($path1 == '' || $path2 == '') return $path2;
990
+   if ($path1 == '' || $path2 == '') {
991
+       return $path2;
992
+   }
923 993
    $s = $path1;
924
-   if (substr($s, -1) != '\\' && substr($s, -1) != '/') $s = $s."/";
925
-   if (substr($path2, 0, 1) == '\\' || substr($path2, 0, 1) == '/')
926
-      $s = $s.substr($path2, 1);
927
-    else
928
-      $s = $s.$path2;
994
+   if (substr($s, -1) != '\\' && substr($s, -1) != '/') {
995
+       $s = $s."/";
996
+   }
997
+   if (substr($path2, 0, 1) == '\\' || substr($path2, 0, 1) == '/') {
998
+         $s = $s.substr($path2, 1);
999
+   } else {
1000
+          $s = $s.$path2;
1001
+    }
929 1002
    return $s; }
930 1003
 
931 1004
 /**
Please login to merge, or discard this patch.
lib/gettext/streams.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,16 +57,18 @@
 block discarded – undo
57 57
   function read($bytes) {
58 58
     $data = substr($this->_str, $this->_pos, $bytes);
59 59
     $this->_pos += $bytes;
60
-    if (strlen($this->_str) < $this->_pos)
61
-      $this->_pos = strlen($this->_str);
60
+    if (strlen($this->_str) < $this->_pos) {
61
+          $this->_pos = strlen($this->_str);
62
+    }
62 63
 
63 64
     return $data;
64 65
   }
65 66
 
66 67
   function seekto($pos) {
67 68
     $this->_pos = $pos;
68
-    if (strlen($this->_str) < $this->_pos)
69
-      $this->_pos = strlen($this->_str);
69
+    if (strlen($this->_str) < $this->_pos) {
70
+          $this->_pos = strlen($this->_str);
71
+    }
70 72
     return $this->_pos;
71 73
   }
72 74
 
Please login to merge, or discard this patch.
lib/gettext/gettext.inc 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -182,7 +182,9 @@  discard block
 block discarded – undo
182 182
  */
183 183
 function _get_codeset($domain = null) {
184 184
     global $text_domains, $default_domain, $LC_CATEGORIES;
185
-    if (!isset($domain)) $domain = $default_domain;
185
+    if (!isset($domain)) {
186
+        $domain = $default_domain;
187
+    }
186 188
     return (isset($text_domains[$domain]->codeset)) ? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding');
187 189
 }
188 190
 
@@ -261,11 +263,13 @@  discard block
 block discarded – undo
261 263
     global $text_domains;
262 264
     // ensure $path ends with a slash ('/' should work for both, but lets still play nice)
263 265
     if (substr(php_uname(), 0, 7) == "Windows") {
264
-      if ($path[strlen($path) - 1] != '\\' and $path[strlen($path) - 1] != '/')
265
-        $path .= '\\';
266
+      if ($path[strlen($path) - 1] != '\\' and $path[strlen($path) - 1] != '/') {
267
+              $path .= '\\';
268
+      }
266 269
     } else {
267
-      if ($path[strlen($path) - 1] != '/')
268
-        $path .= '/';
270
+      if ($path[strlen($path) - 1] != '/') {
271
+              $path .= '/';
272
+      }
269 273
     }
270 274
     if (!array_key_exists($domain, $text_domains)) {
271 275
       // Initialize an empty domain object.
Please login to merge, or discard this patch.
lib/phpqrcode/qrtools.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,8 +62,9 @@  discard block
 block discarded – undo
62 62
                 
63 63
             foreach ($qrTab as $line) {
64 64
                 $arrAdd = array();
65
-                foreach (str_split($line) as $char)
66
-                    $arrAdd[] = ($char == '1') ? 1 : 0;
65
+                foreach (str_split($line) as $char) {
66
+                                    $arrAdd[] = ($char == '1') ? 1 : 0;
67
+                }
67 68
                 $barcode_array['bcode'][] = $arrAdd;
68 69
             }
69 70
                     
@@ -91,8 +92,9 @@  discard block
 block discarded – undo
91 92
 				
92 93
 				$width = count($frame);
93 94
 				$bitMask = array_fill(0, $width, array_fill(0, $width, 0));
94
-				for ($maskNo = 0; $maskNo < 8; $maskNo++)
95
-					$mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true);
95
+				for ($maskNo = 0; $maskNo < 8; $maskNo++) {
96
+									$mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true);
97
+				}
96 98
             }
97 99
 			
98 100
 			QRtools::markTime('after_build_cache');
Please login to merge, or discard this patch.
lib/phpqrcode/index.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,19 +43,22 @@  discard block
 block discarded – undo
43 43
     //processing form input
44 44
     //remember to sanitize user input in real-life solution !!!
45 45
     $errorCorrectionLevel = 'L';
46
-    if (isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L', 'M', 'Q', 'H')))
47
-        $errorCorrectionLevel = $_REQUEST['level'];    
46
+    if (isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L', 'M', 'Q', 'H'))) {
47
+            $errorCorrectionLevel = $_REQUEST['level'];
48
+    }
48 49
 
49 50
     $matrixPointSize = 4;
50
-    if (isset($_REQUEST['size']))
51
-        $matrixPointSize = min(max((int) $_REQUEST['size'], 1), 10);
51
+    if (isset($_REQUEST['size'])) {
52
+            $matrixPointSize = min(max((int) $_REQUEST['size'], 1), 10);
53
+    }
52 54
 
53 55
 
54 56
     if (isset($_REQUEST['data'])) { 
55 57
     
56 58
         //it's very important!
57
-        if (trim($_REQUEST['data']) == '')
58
-            die('data cannot be empty! <a href="?">back</a>');
59
+        if (trim($_REQUEST['data']) == '') {
60
+                    die('data cannot be empty! <a href="?">back</a>');
61
+        }
59 62
             
60 63
         // user data
61 64
         $filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
@@ -83,8 +86,9 @@  discard block
 block discarded – undo
83 86
         </select>&nbsp;
84 87
         Size:&nbsp;<select name="size">';
85 88
         
86
-    for ($i = 1; $i <= 10; $i++)
87
-        echo '<option value="'.$i.'"'.(($matrixPointSize == $i) ? ' selected' : '').'>'.$i.'</option>';
89
+    for ($i = 1; $i <= 10; $i++) {
90
+            echo '<option value="'.$i.'"'.(($matrixPointSize == $i) ? ' selected' : '').'>'.$i.'</option>';
91
+    }
88 92
         
89 93
     echo '</select>&nbsp;
90 94
         <input type="submit" value="GENERATE"></form><hr/>';
Please login to merge, or discard this patch.