Completed
Pull Request — master (#223)
by
unknown
01:56
created
config/default.php 1 patch
Braces   +14 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,10 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php exit;
2 2
 
3 3
 //Check everything exists before using it
4
-if(!isset($_SERVER['HTTP_ACCEPT_ENCODING']))
4
+if(!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
5 5
 	$_SERVER['HTTP_ACCEPT_ENCODING'] = '';
6
-if(!isset($_SERVER['HTTP_USER_AGENT']))
6
+}
7
+if(!isset($_SERVER['HTTP_USER_AGENT'])) {
7 8
 	$_SERVER['HTTP_USER_AGENT'] = '';
9
+}
8 10
 
9 11
 // Determine supported compression method
10 12
 $gzip = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
@@ -19,16 +21,19 @@  discard block
 block discarded – undo
19 21
 {
20 22
 	$version = floatval($matches[1]);
21 23
 
22
-	if ($version < 6)
23
-		$encoding = 'none';
24
+	if ($version < 6) {
25
+			$encoding = 'none';
26
+	}
24 27
 
25
-	if ($version == 6 && !strstr($_SERVER['HTTP_USER_AGENT'], 'EV1'))
26
-		$encoding = 'none';
27
-}
28
+	if ($version == 6 && !strstr($_SERVER['HTTP_USER_AGENT'], 'EV1')) {
29
+			$encoding = 'none';
30
+	}
31
+	}
28 32
 
29 33
 //Some servers compress the output of PHP - Don't break in those cases
30
-if(ini_get('output_handler') == 'ob_gzhandler' || ini_get('zlib.output_compression') == 1)
34
+if(ini_get('output_handler') == 'ob_gzhandler' || ini_get('zlib.output_compression') == 1) {
31 35
 	$encoding = 'none';
36
+}
32 37
 
33 38
 $iscompressed = file_exists(__FILE__.'.'.$encoding);
34 39
 if($encoding != 'none' && $iscompressed == false)
@@ -36,7 +41,7 @@  discard block
 block discarded – undo
36 41
 	$flag = ($encoding == 'gzip' ? FORCE_GZIP : FORCE_DEFLATE);
37 42
 	$code = file_get_contents(__FILE__.'.none');
38 43
 	$contents = gzencode($code,9,$flag);
39
-}else{
44
+} else{
40 45
 	//Get data
41 46
 	$contents = file_get_contents(__FILE__.'.'.$encoding);
42 47
 }
Please login to merge, or discard this patch.
classes/autoptimizeConfig.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+    exit;
4
+}
5
+// Exit if accessed directly.
3 6
 
4 7
 class autoptimizeConfig
5 8
 {
@@ -791,10 +794,13 @@  discard block
 block discarded – undo
791 794
             <ul>
792 795
                 <?php if ( $maxitems == 0 ) : ?>
793 796
                     <li><?php _e( 'No items', 'autoptimize' ); ?></li>
794
-                <?php else : ?>
797
+                <?php else {
798
+    : ?>
795 799
                     <?php foreach ( $rss_items as $item ) : ?>
796 800
                         <li>
797
-                            <a href="<?php echo esc_url( $item->get_permalink() ); ?>"
801
+                            <a href="<?php echo esc_url( $item->get_permalink() );
802
+}
803
+?>"
798 804
                                 title="<?php printf( __( 'Posted %s', 'autoptimize' ), $item->get_date('j F Y | g:i a') ); ?>">
799 805
                                 <?php echo esc_html( $item->get_title() ); ?>
800 806
                             </a>
Please login to merge, or discard this patch.
classes/external/php/plugin-update-checker/vendor/ParsedownLegacy.php 1 patch
Braces   +21 added lines, -27 removed lines patch added patch discarded remove patch
@@ -178,8 +178,7 @@  discard block
 block discarded – undo
178 178
                     $CurrentBlock = $Block;
179 179
 
180 180
                     continue;
181
-                }
182
-                else
181
+                } else
183 182
                 {
184 183
                     if (method_exists($this, 'block'.$CurrentBlock['type'].'Complete'))
185 184
                     {
@@ -240,8 +239,7 @@  discard block
 block discarded – undo
240 239
             if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted']))
241 240
             {
242 241
                 $CurrentBlock['element']['text'] .= "\n".$text;
243
-            }
244
-            else
242
+            } else
245 243
             {
246 244
                 $Blocks []= $CurrentBlock;
247 245
 
@@ -696,8 +694,7 @@  discard block
 block discarded – undo
696 694
 
697 695
                     $Block['void'] = true;
698 696
                 }
699
-            }
700
-            else
697
+            } else
701 698
             {
702 699
                 if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
703 700
                 {
@@ -721,18 +718,21 @@  discard block
 block discarded – undo
721 718
             return;
722 719
         }
723 720
 
724
-        if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open
721
+        if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) {
722
+            # open
725 723
         {
726 724
             $Block['depth'] ++;
727 725
         }
726
+        }
728 727
 
729
-        if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close
728
+        if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) {
729
+            # close
730 730
         {
731 731
             if ($Block['depth'] > 0)
732 732
             {
733 733
                 $Block['depth'] --;
734
-            }
735
-            else
734
+        }
735
+            } else
736 736
             {
737 737
                 $Block['closed'] = true;
738 738
             }
@@ -1010,10 +1010,12 @@  discard block
 block discarded – undo
1010 1010
                     continue;
1011 1011
                 }
1012 1012
 
1013
-                if (isset($Inline['position']) and $Inline['position'] > $markerPosition) # position is ahead of marker
1013
+                if (isset($Inline['position']) and $Inline['position'] > $markerPosition) {
1014
+                    # position is ahead of marker
1014 1015
                 {
1015 1016
                     continue;
1016 1017
                 }
1018
+                }
1017 1019
 
1018 1020
                 if ( ! isset($Inline['position']))
1019 1021
                 {
@@ -1105,12 +1107,10 @@  discard block
 block discarded – undo
1105 1107
         if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches))
1106 1108
         {
1107 1109
             $emphasis = 'strong';
1108
-        }
1109
-        elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches))
1110
+        } elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches))
1110 1111
         {
1111 1112
             $emphasis = 'em';
1112
-        }
1113
-        else
1113
+        } else
1114 1114
         {
1115 1115
             return;
1116 1116
         }
@@ -1193,8 +1193,7 @@  discard block
 block discarded – undo
1193 1193
             $extent += strlen($matches[0]);
1194 1194
 
1195 1195
             $remainder = substr($remainder, $extent);
1196
-        }
1197
-        else
1196
+        } else
1198 1197
         {
1199 1198
             return;
1200 1199
         }
@@ -1209,8 +1208,7 @@  discard block
 block discarded – undo
1209 1208
             }
1210 1209
 
1211 1210
             $extent += strlen($matches[0]);
1212
-        }
1213
-        else
1211
+        } else
1214 1212
         {
1215 1213
             if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches))
1216 1214
             {
@@ -1218,8 +1216,7 @@  discard block
 block discarded – undo
1218 1216
                 $definition = strtolower($definition);
1219 1217
 
1220 1218
                 $extent += strlen($matches[0]);
1221
-            }
1222
-            else
1219
+            } else
1223 1220
             {
1224 1221
                 $definition = strtolower($Element['text']);
1225 1222
             }
@@ -1372,8 +1369,7 @@  discard block
 block discarded – undo
1372 1369
         if ($this->breaksEnabled)
1373 1370
         {
1374 1371
             $text = preg_replace('/[ ]*\n/', "<br />\n", $text);
1375
-        }
1376
-        else
1372
+        } else
1377 1373
         {
1378 1374
             $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "<br />\n", $text);
1379 1375
             $text = str_replace(" \n", "\n", $text);
@@ -1410,15 +1406,13 @@  discard block
 block discarded – undo
1410 1406
             if (isset($Element['handler']))
1411 1407
             {
1412 1408
                 $markup .= $this->{$Element['handler']}($Element['text']);
1413
-            }
1414
-            else
1409
+            } else
1415 1410
             {
1416 1411
                 $markup .= $Element['text'];
1417 1412
             }
1418 1413
 
1419 1414
             $markup .= '</'.$Element['name'].'>';
1420
-        }
1421
-        else
1415
+        } else
1422 1416
         {
1423 1417
             $markup .= ' />';
1424 1418
         }
Please login to merge, or discard this patch.
classes/external/php/plugin-update-checker/vendor/Parsedown.php 1 patch
Braces   +18 added lines, -26 removed lines patch added patch discarded remove patch
@@ -172,8 +172,7 @@  discard block
 block discarded – undo
172 172
                     $CurrentBlock = $Block;
173 173
 
174 174
                     continue;
175
-                }
176
-                else
175
+                } else
177 176
                 {
178 177
                     if ($this->isBlockCompletable($CurrentBlock['type']))
179 178
                     {
@@ -232,8 +231,7 @@  discard block
 block discarded – undo
232 231
             if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted']))
233 232
             {
234 233
                 $CurrentBlock['element']['text'] .= "\n".$text;
235
-            }
236
-            else
234
+            } else
237 235
             {
238 236
                 $Blocks []= $CurrentBlock;
239 237
 
@@ -700,8 +698,7 @@  discard block
 block discarded – undo
700 698
 
701 699
                     $Block['void'] = true;
702 700
                 }
703
-            }
704
-            else
701
+            } else
705 702
             {
706 703
                 if (isset($matches[2]) or in_array($matches[1], $this->voidElements))
707 704
                 {
@@ -725,18 +722,21 @@  discard block
 block discarded – undo
725 722
             return;
726 723
         }
727 724
 
728
-        if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open
725
+        if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) {
726
+            # open
729 727
         {
730 728
             $Block['depth'] ++;
731 729
         }
730
+        }
732 731
 
733
-        if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close
732
+        if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) {
733
+            # close
734 734
         {
735 735
             if ($Block['depth'] > 0)
736 736
             {
737 737
                 $Block['depth'] --;
738
-            }
739
-            else
738
+        }
739
+            } else
740 740
             {
741 741
                 $Block['closed'] = true;
742 742
             }
@@ -1113,12 +1113,10 @@  discard block
 block discarded – undo
1113 1113
         if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches))
1114 1114
         {
1115 1115
             $emphasis = 'strong';
1116
-        }
1117
-        elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches))
1116
+        } elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches))
1118 1117
         {
1119 1118
             $emphasis = 'em';
1120
-        }
1121
-        else
1119
+        } else
1122 1120
         {
1123 1121
             return;
1124 1122
         }
@@ -1201,8 +1199,7 @@  discard block
 block discarded – undo
1201 1199
             $extent += strlen($matches[0]);
1202 1200
 
1203 1201
             $remainder = substr($remainder, $extent);
1204
-        }
1205
-        else
1202
+        } else
1206 1203
         {
1207 1204
             return;
1208 1205
         }
@@ -1217,8 +1214,7 @@  discard block
 block discarded – undo
1217 1214
             }
1218 1215
 
1219 1216
             $extent += strlen($matches[0]);
1220
-        }
1221
-        else
1217
+        } else
1222 1218
         {
1223 1219
             if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches))
1224 1220
             {
@@ -1226,8 +1222,7 @@  discard block
 block discarded – undo
1226 1222
                 $definition = strtolower($definition);
1227 1223
 
1228 1224
                 $extent += strlen($matches[0]);
1229
-            }
1230
-            else
1225
+            } else
1231 1226
             {
1232 1227
                 $definition = strtolower($Element['text']);
1233 1228
             }
@@ -1375,8 +1370,7 @@  discard block
 block discarded – undo
1375 1370
         if ($this->breaksEnabled)
1376 1371
         {
1377 1372
             $text = preg_replace('/[ ]*\n/', "<br />\n", $text);
1378
-        }
1379
-        else
1373
+        } else
1380 1374
         {
1381 1375
             $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "<br />\n", $text);
1382 1376
             $text = str_replace(" \n", "\n", $text);
@@ -1413,15 +1407,13 @@  discard block
 block discarded – undo
1413 1407
             if (isset($Element['handler']))
1414 1408
             {
1415 1409
                 $markup .= $this->{$Element['handler']}($Element['text']);
1416
-            }
1417
-            else
1410
+            } else
1418 1411
             {
1419 1412
                 $markup .= $Element['text'];
1420 1413
             }
1421 1414
 
1422 1415
             $markup .= '</'.$Element['name'].'>';
1423
-        }
1424
-        else
1416
+        } else
1425 1417
         {
1426 1418
             $markup .= ' />';
1427 1419
         }
Please login to merge, or discard this patch.
classes/external/php/plugin-update-checker/vendor/readme-parser.php 1 patch
Braces   +73 added lines, -47 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 	function parse_readme_contents( $file_contents ) {
22 22
 		$file_contents = str_replace(array("\r\n", "\r"), "\n", $file_contents);
23 23
 		$file_contents = trim($file_contents);
24
-		if ( 0 === strpos( $file_contents, "\xEF\xBB\xBF" ) )
25
-			$file_contents = substr( $file_contents, 3 );
24
+		if ( 0 === strpos( $file_contents, "\xEF\xBB\xBF" ) ) {
25
+					$file_contents = substr( $file_contents, 3 );
26
+		}
26 27
 
27 28
 		// Markdown transformations
28 29
 		$file_contents = preg_replace( "|^###([^#]+)#*?\s*?\n|im", '=$1='."\n",     $file_contents );
@@ -31,8 +32,10 @@  discard block
 block discarded – undo
31 32
 
32 33
 		// === Plugin Name ===
33 34
 		// Must be the very first thing.
34
-		if ( !preg_match('|^===(.*)===|', $file_contents, $_name) )
35
-			return array(); // require a name
35
+		if ( !preg_match('|^===(.*)===|', $file_contents, $_name) ) {
36
+					return array();
37
+		}
38
+		// require a name
36 39
 		$name = trim($_name[1], '=');
37 40
 		$name = $this->sanitize_text( $name );
38 41
 
@@ -40,31 +43,36 @@  discard block
 block discarded – undo
40 43
 
41 44
 
42 45
 		// Requires at least: 1.5
43
-		if ( preg_match('|Requires at least:(.*)|i', $file_contents, $_requires_at_least) )
44
-			$requires_at_least = $this->sanitize_text($_requires_at_least[1]);
45
-		else
46
-			$requires_at_least = NULL;
46
+		if ( preg_match('|Requires at least:(.*)|i', $file_contents, $_requires_at_least) ) {
47
+					$requires_at_least = $this->sanitize_text($_requires_at_least[1]);
48
+		} else {
49
+					$requires_at_least = NULL;
50
+		}
47 51
 
48 52
 
49 53
 		// Tested up to: 2.1
50
-		if ( preg_match('|Tested up to:(.*)|i', $file_contents, $_tested_up_to) )
51
-			$tested_up_to = $this->sanitize_text( $_tested_up_to[1] );
52
-		else
53
-			$tested_up_to = NULL;
54
+		if ( preg_match('|Tested up to:(.*)|i', $file_contents, $_tested_up_to) ) {
55
+					$tested_up_to = $this->sanitize_text( $_tested_up_to[1] );
56
+		} else {
57
+					$tested_up_to = NULL;
58
+		}
54 59
 
55 60
 
56 61
 		// Stable tag: 10.4-ride-the-fire-eagle-danger-day
57
-		if ( preg_match('|Stable tag:(.*)|i', $file_contents, $_stable_tag) )
58
-			$stable_tag = $this->sanitize_text( $_stable_tag[1] );
59
-		else
60
-			$stable_tag = NULL; // we assume trunk, but don't set it here to tell the difference between specified trunk and default trunk
62
+		if ( preg_match('|Stable tag:(.*)|i', $file_contents, $_stable_tag) ) {
63
+					$stable_tag = $this->sanitize_text( $_stable_tag[1] );
64
+		} else {
65
+					$stable_tag = NULL;
66
+		}
67
+		// we assume trunk, but don't set it here to tell the difference between specified trunk and default trunk
61 68
 
62 69
 
63 70
 		// Tags: some tag, another tag, we like tags
64 71
 		if ( preg_match('|Tags:(.*)|i', $file_contents, $_tags) ) {
65 72
 			$tags = preg_split('|,[\s]*?|', trim($_tags[1]));
66
-			foreach ( array_keys($tags) as $t )
67
-				$tags[$t] = $this->sanitize_text( $tags[$t] );
73
+			foreach ( array_keys($tags) as $t ) {
74
+							$tags[$t] = $this->sanitize_text( $tags[$t] );
75
+			}
68 76
 		} else {
69 77
 			$tags = array();
70 78
 		}
@@ -76,18 +84,20 @@  discard block
 block discarded – undo
76 84
 			$temp_contributors = preg_split('|,[\s]*|', trim($_contributors[1]));
77 85
 			foreach ( array_keys($temp_contributors) as $c ) {
78 86
 				$tmp_sanitized = $this->user_sanitize( $temp_contributors[$c] );
79
-				if ( strlen(trim($tmp_sanitized)) > 0 )
80
-					$contributors[$c] = $tmp_sanitized;
87
+				if ( strlen(trim($tmp_sanitized)) > 0 ) {
88
+									$contributors[$c] = $tmp_sanitized;
89
+				}
81 90
 				unset($tmp_sanitized);
82 91
 			}
83 92
 		}
84 93
 
85 94
 
86 95
 		// Donate Link: URL
87
-		if ( preg_match('|Donate link:(.*)|i', $file_contents, $_donate_link) )
88
-			$donate_link = esc_url( $_donate_link[1] );
89
-		else
90
-			$donate_link = NULL;
96
+		if ( preg_match('|Donate link:(.*)|i', $file_contents, $_donate_link) ) {
97
+					$donate_link = esc_url( $_donate_link[1] );
98
+		} else {
99
+					$donate_link = NULL;
100
+		}
91 101
 
92 102
 
93 103
 		// togs, conts, etc are optional and order shouldn't matter.  So we chop them only after we've grabbed their values.
@@ -102,17 +112,21 @@  discard block
 block discarded – undo
102 112
 
103 113
 
104 114
 		// short-description fu
105
-		if ( !preg_match('/(^(.*?))^[\s]*=+?[\s]*.+?[\s]*=+?/ms', $file_contents, $_short_description) )
106
-			$_short_description = array( 1 => &$file_contents, 2 => &$file_contents );
115
+		if ( !preg_match('/(^(.*?))^[\s]*=+?[\s]*.+?[\s]*=+?/ms', $file_contents, $_short_description) ) {
116
+					$_short_description = array( 1 => &$file_contents, 2 => &$file_contents );
117
+		}
107 118
 		$short_desc_filtered = $this->sanitize_text( $_short_description[2] );
108 119
 		$short_desc_length = strlen($short_desc_filtered);
109 120
 		$short_description = substr($short_desc_filtered, 0, 150);
110
-		if ( $short_desc_length > strlen($short_description) )
111
-			$truncated = true;
112
-		else
113
-			$truncated = false;
114
-		if ( $_short_description[1] )
115
-			$file_contents = $this->chop_string( $file_contents, $_short_description[1] ); // yes, the [1] is intentional
121
+		if ( $short_desc_length > strlen($short_description) ) {
122
+					$truncated = true;
123
+		} else {
124
+					$truncated = false;
125
+		}
126
+		if ( $_short_description[1] ) {
127
+					$file_contents = $this->chop_string( $file_contents, $_short_description[1] );
128
+		}
129
+		// yes, the [1] is intentional
116 130
 
117 131
 		// == Section ==
118 132
 		// Break into sections
@@ -139,16 +153,18 @@  discard block
 block discarded – undo
139 153
 				unset($sections[$special_section]);
140 154
 			}
141 155
 		}
142
-		if ( isset($final_sections['change_log']) && empty($final_sections['changelog']) )
143
-			$final_sections['changelog'] = $final_sections['change_log'];
156
+		if ( isset($final_sections['change_log']) && empty($final_sections['changelog']) ) {
157
+					$final_sections['changelog'] = $final_sections['change_log'];
158
+		}
144 159
 
145 160
 
146 161
 		$final_screenshots = array();
147 162
 		if ( isset($final_sections['screenshots']) ) {
148 163
 			preg_match_all('|<li>(.*?)</li>|s', $final_sections['screenshots'], $screenshots, PREG_SET_ORDER);
149 164
 			if ( $screenshots ) {
150
-				foreach ( (array) $screenshots as $ss )
151
-					$final_screenshots[] = $ss[1];
165
+				foreach ( (array) $screenshots as $ss ) {
166
+									$final_screenshots[] = $ss[1];
167
+				}
152 168
 			}
153 169
 		}
154 170
 
@@ -157,8 +173,9 @@  discard block
 block discarded – undo
157 173
 		$upgrade_notice = array();
158 174
 		if ( isset($final_sections['upgrade_notice']) ) {
159 175
 			$split = preg_split( '#<h4>(.*?)</h4>#', $final_sections['upgrade_notice'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
160
-			for ( $i = 0; $i < count( $split ); $i += 2 )
161
-				$upgrade_notice[$this->sanitize_text( $split[$i] )] = substr( $this->sanitize_text( $split[$i + 1] ), 0, 300 );
176
+			for ( $i = 0; $i < count( $split ); $i += 2 ) {
177
+							$upgrade_notice[$this->sanitize_text( $split[$i] )] = substr( $this->sanitize_text( $split[$i + 1] ), 0, 300 );
178
+			}
162 179
 			unset( $final_sections['upgrade_notice'] );
163 180
 		}
164 181
 
@@ -214,8 +231,10 @@  discard block
 block discarded – undo
214 231
 	}
215 232
 
216 233
 	function user_sanitize( $text, $strict = false ) { // whitelisted chars
217
-		if ( function_exists('user_sanitize') ) // bbPress native
234
+		if ( function_exists('user_sanitize') ) {
235
+		    // bbPress native
218 236
 			return user_sanitize( $text, $strict );
237
+		}
219 238
 
220 239
 		if ( $strict ) {
221 240
 			$text = preg_replace('/[^a-z0-9-]/i', '', $text);
@@ -276,8 +295,9 @@  discard block
 block discarded – undo
276 295
 	function code_trick( $text, $markdown ) { // Don't use bbPress native function - it's incompatible with Markdown
277 296
 		// If doing markdown, first take any user formatted code blocks and turn them into backticks so that
278 297
 		// markdown will preserve things like underscores in code blocks
279
-		if ( $markdown )
280
-			$text = preg_replace_callback("!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s", array( __CLASS__,'decodeit'), $text);
298
+		if ( $markdown ) {
299
+					$text = preg_replace_callback("!(<pre><code>|<code>)(.*?)(</code></pre>|</code>)!s", array( __CLASS__,'decodeit'), $text);
300
+		}
281 301
 
282 302
 		$text = str_replace(array("\r\n", "\r"), "\n", $text);
283 303
 		if ( !$markdown ) {
@@ -299,8 +319,10 @@  discard block
 block discarded – undo
299 319
 	}
300 320
 
301 321
 	function encodeit( $matches ) {
302
-		if ( function_exists('encodeit') ) // bbPress native
322
+		if ( function_exists('encodeit') ) {
323
+		    // bbPress native
303 324
 			return encodeit( $matches );
325
+		}
304 326
 
305 327
 		$text = trim($matches[2]);
306 328
 		$text = htmlspecialchars($text, ENT_QUOTES);
@@ -309,14 +331,17 @@  discard block
 block discarded – undo
309 331
 		$text = str_replace('&amp;lt;', '&lt;', $text);
310 332
 		$text = str_replace('&amp;gt;', '&gt;', $text);
311 333
 		$text = "<code>$text</code>";
312
-		if ( "`" != $matches[1] )
313
-			$text = "<pre>$text</pre>";
334
+		if ( "`" != $matches[1] ) {
335
+					$text = "<pre>$text</pre>";
336
+		}
314 337
 		return $text;
315 338
 	}
316 339
 
317 340
 	function decodeit( $matches ) {
318
-		if ( function_exists('decodeit') ) // bbPress native
341
+		if ( function_exists('decodeit') ) {
342
+		    // bbPress native
319 343
 			return decodeit( $matches );
344
+		}
320 345
 
321 346
 		$text = $matches[2];
322 347
 		$trans_table = array_flip(get_html_translation_table(HTML_ENTITIES));
@@ -324,8 +349,9 @@  discard block
 block discarded – undo
324 349
 		$text = str_replace('<br />', '', $text);
325 350
 		$text = str_replace('&#38;', '&', $text);
326 351
 		$text = str_replace('&#39;', "'", $text);
327
-		if ( '<pre><code>' == $matches[1] )
328
-			$text = "\n$text\n";
352
+		if ( '<pre><code>' == $matches[1] ) {
353
+					$text = "\n$text\n";
354
+		}
329 355
 		return "`$text`";
330 356
 	}
331 357
 
Please login to merge, or discard this patch.