Passed
Push — 1.10.x ( 4b2d9f...3e6bac )
by Yannick
182:52 queued 136:22
created
main/inc/lib/group_portal_manager.lib.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -563,8 +563,9 @@  discard block
 block discarded – undo
563 563
                 $new_relation_type[] = "'$rel'";
564 564
             }
565 565
             $relation_type = implode(',', $new_relation_type);
566
-            if (!empty($relation_type))
567
-                $where_relation_condition = "AND gu.relation_type IN ($relation_type) ";
566
+            if (!empty($relation_type)) {
567
+                            $where_relation_condition = "AND gu.relation_type IN ($relation_type) ";
568
+            }
568 569
         }
569 570
 
570 571
         $sql = "SELECT
@@ -1086,8 +1087,9 @@  discard block
 block discarded – undo
1086 1087
                 $thumbwidth = $max_size_for_picture;
1087 1088
             }
1088 1089
             $new_height = round(($thumbwidth / $picture_infos['width']) * $picture_infos['height']);
1089
-            if ($new_height > $max_size_for_picture)
1090
-                $new_height = $thumbwidth;
1090
+            if ($new_height > $max_size_for_picture) {
1091
+                            $new_height = $thumbwidth;
1092
+            }
1091 1093
             $temp->resize($thumbwidth, $new_height, 0);
1092 1094
         }
1093 1095
 
Please login to merge, or discard this patch.
main/inc/lib/diagnoser.lib.php 1 patch
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -158,8 +158,9 @@  discard block
 block discarded – undo
158 158
         $array[] = $this->build_setting($status, '[INI]', 'display_errors', 'http://www.php.net/manual/en/ini.core.php#ini.display_errors', $setting, $req_setting, 'on_off', get_lang('DisplayErrorsInfo'));
159 159
 
160 160
         $setting = ini_get('default_charset');
161
-        if ($setting == '')
162
-            $setting = null;
161
+        if ($setting == '') {
162
+                    $setting = null;
163
+        }
163 164
         $req_setting = null;
164 165
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_ERROR;
165 166
         $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo'));
@@ -177,22 +178,25 @@  discard block
 block discarded – undo
177 178
         $setting = ini_get('memory_limit');
178 179
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
179 180
         $status = self :: STATUS_ERROR;
180
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
181
-            $status = self :: STATUS_OK;
181
+        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT) {
182
+                    $status = self :: STATUS_OK;
183
+        }
182 184
         $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo'));
183 185
 
184 186
         $setting = ini_get('post_max_size');
185 187
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
186 188
         $status = self :: STATUS_ERROR;
187
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
188
-            $status = self :: STATUS_OK;
189
+        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE) {
190
+                    $status = self :: STATUS_OK;
191
+        }
189 192
         $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo'));
190 193
 
191 194
         $setting = ini_get('upload_max_filesize');
192 195
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
193 196
         $status = self :: STATUS_ERROR;
194
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
195
-            $status = self :: STATUS_OK;
197
+        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) {
198
+                    $status = self :: STATUS_OK;
199
+        }
196 200
         $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo'));
197 201
 
198 202
         $setting = ini_get('variables_order');
@@ -205,7 +209,7 @@  discard block
 block discarded – undo
205 209
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
206 210
         $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo'));
207 211
 
208
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
212
+        if (api_check_browscap()){$setting = true;} else{$setting=false;}
209 213
         $req_setting = true;
210 214
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
211 215
         $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo'));
Please login to merge, or discard this patch.
main/inc/lib/browser/Browser.php 1 patch
Braces   +16 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1152,68 +1152,52 @@
 block discarded – undo
1152 1152
         if (stripos($this->_agent, 'windows') !== false) 
1153 1153
         {
1154 1154
             $this->_platform = self::PLATFORM_WINDOWS;
1155
-        } 
1156
-        else if (stripos($this->_agent, 'iPad') !== false) 
1155
+        } else if (stripos($this->_agent, 'iPad') !== false) 
1157 1156
         {
1158 1157
             $this->_platform = self::PLATFORM_IPAD;
1159
-        } 
1160
-        else if (stripos($this->_agent, 'iPod') !== false) 
1158
+        } else if (stripos($this->_agent, 'iPod') !== false) 
1161 1159
         {
1162 1160
             $this->_platform = self::PLATFORM_IPOD;
1163
-        } 
1164
-        else if (stripos($this->_agent, 'iPhone') !== false) 
1161
+        } else if (stripos($this->_agent, 'iPhone') !== false) 
1165 1162
         {
1166 1163
             $this->_platform = self::PLATFORM_IPHONE;
1167
-        } 
1168
-        elseif (stripos($this->_agent, 'mac') !== false) 
1164
+        } elseif (stripos($this->_agent, 'mac') !== false) 
1169 1165
         {
1170 1166
             $this->_platform = self::PLATFORM_APPLE;
1171
-        } 
1172
-        elseif (stripos($this->_agent, 'android') !== false) 
1167
+        } elseif (stripos($this->_agent, 'android') !== false) 
1173 1168
         {
1174 1169
             $this->_platform = self::PLATFORM_ANDROID;
1175
-        } 
1176
-        elseif (stripos($this->_agent, 'linux') !== false) 
1170
+        } elseif (stripos($this->_agent, 'linux') !== false) 
1177 1171
         {
1178 1172
             $this->_platform = self::PLATFORM_LINUX;
1179
-        } 
1180
-        else if (stripos($this->_agent, 'Nokia') !== false) 
1173
+        } else if (stripos($this->_agent, 'Nokia') !== false) 
1181 1174
         {
1182 1175
             $this->_platform = self::PLATFORM_NOKIA;
1183
-        } 
1184
-        else if (stripos($this->_agent, 'BlackBerry') !== false) 
1176
+        } else if (stripos($this->_agent, 'BlackBerry') !== false) 
1185 1177
         {
1186 1178
             $this->_platform = self::PLATFORM_BLACKBERRY;
1187
-        } 
1188
-        elseif (stripos($this->_agent, 'FreeBSD') !== false) 
1179
+        } elseif (stripos($this->_agent, 'FreeBSD') !== false) 
1189 1180
         {
1190 1181
             $this->_platform = self::PLATFORM_FREEBSD;
1191
-        } 
1192
-        elseif (stripos($this->_agent, 'OpenBSD') !== false) 
1182
+        } elseif (stripos($this->_agent, 'OpenBSD') !== false) 
1193 1183
         {
1194 1184
             $this->_platform = self::PLATFORM_OPENBSD;
1195
-        } 
1196
-        elseif (stripos($this->_agent, 'NetBSD') !== false) 
1185
+        } elseif (stripos($this->_agent, 'NetBSD') !== false) 
1197 1186
         {
1198 1187
             $this->_platform = self::PLATFORM_NETBSD;
1199
-        } 
1200
-        elseif (stripos($this->_agent, 'OpenSolaris') !== false) 
1188
+        } elseif (stripos($this->_agent, 'OpenSolaris') !== false) 
1201 1189
         {
1202 1190
             $this->_platform = self::PLATFORM_OPENSOLARIS;
1203
-        } 
1204
-        elseif (stripos($this->_agent, 'SunOS') !== false) 
1191
+        } elseif (stripos($this->_agent, 'SunOS') !== false) 
1205 1192
         {
1206 1193
             $this->_platform = self::PLATFORM_SUNOS;
1207
-        } 
1208
-        elseif (stripos($this->_agent, 'OS\/2') !== false) 
1194
+        } elseif (stripos($this->_agent, 'OS\/2') !== false) 
1209 1195
         {
1210 1196
             $this->_platform = self::PLATFORM_OS2;
1211
-        } 
1212
-        elseif (stripos($this->_agent, 'BeOS') !== false) 
1197
+        } elseif (stripos($this->_agent, 'BeOS') !== false) 
1213 1198
         {
1214 1199
             $this->_platform = self::PLATFORM_BEOS;
1215
-        } 
1216
-        elseif (stripos($this->_agent, 'win') !== false) 
1200
+        } elseif (stripos($this->_agent, 'win') !== false) 
1217 1201
         {
1218 1202
             $this->_platform = self::PLATFORM_WINDOWS;
1219 1203
         }
Please login to merge, or discard this patch.
main/inc/lib/phpmailer/class.smtp.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,8 +143,9 @@
 block discarded – undo
143 143
 
144 144
     // SMTP server can take longer to respond, give longer timeout for first read
145 145
     // Windows does not have support for this timeout function
146
-    if(substr(PHP_OS, 0, 3) != "WIN")
147
-     socket_set_timeout($this->smtp_conn, $tval, 0);
146
+    if(substr(PHP_OS, 0, 3) != "WIN") {
147
+         socket_set_timeout($this->smtp_conn, $tval, 0);
148
+    }
148 149
 
149 150
     // get any announcement
150 151
     $announce = $this->get_lines();
Please login to merge, or discard this patch.
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.