@@ -173,7 +173,7 @@ |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | $entry = Multi_Entry::from_entries( array_filter( $multientry ) ); |
176 | - } else { |
|
176 | + } else { |
|
177 | 177 | /** |
178 | 178 | * A regular one. |
179 | 179 | */ |
@@ -61,14 +61,16 @@ discard block |
||
61 | 61 | $value = $this->get_value( $atts ); |
62 | 62 | |
63 | 63 | if ( false === $operator && is_null( $value ) ) { |
64 | - if ( false !== $atts['if'] ) { // Only-if test |
|
64 | + if ( false !== $atts['if'] ) { |
|
65 | +// Only-if test |
|
65 | 66 | $match = $authed && ! in_array( strtolower( $atts['if'] ), array( '', '0', 'false', 'no' ) ); |
66 | 67 | } else { |
67 | 68 | $match = $authed; // Just login test |
68 | 69 | } |
69 | 70 | |
70 | 71 | $output = $this->get_output( $match, $atts, $content ); |
71 | - } else { // Regular test |
|
72 | + } else { |
|
73 | +// Regular test |
|
72 | 74 | |
73 | 75 | $output = $content; |
74 | 76 | |
@@ -199,12 +201,15 @@ discard block |
||
199 | 201 | $opens = 0; // inner opens |
200 | 202 | $found = false; // found split position |
201 | 203 | |
202 | - while ( $content ) { // scan |
|
204 | + while ( $content ) { |
|
205 | +// scan |
|
203 | 206 | |
204 | 207 | if ( ! preg_match( '#(.*?)(\[\/?(gvlogic|else).*?])(.*)#s', $content, $matches ) ) { |
205 | - if ( ! $found ) { // We're still iffing. |
|
208 | + if ( ! $found ) { |
|
209 | +// We're still iffing. |
|
206 | 210 | $if .= $content; |
207 | - } else { // We are elsing |
|
211 | + } else { |
|
212 | +// We are elsing |
|
208 | 213 | $else .= $content; |
209 | 214 | } |
210 | 215 | break; // No more shortcodes |
@@ -212,9 +217,11 @@ discard block |
||
212 | 217 | |
213 | 218 | list( $_, $before_shortcode, $shortcode, $_, $after_shortcode ) = $matches; |
214 | 219 | |
215 | - if ( ! $found ) { // We're still iffing. |
|
220 | + if ( ! $found ) { |
|
221 | +// We're still iffing. |
|
216 | 222 | $if .= $before_shortcode; |
217 | - } else { // We are elsing |
|
223 | + } else { |
|
224 | +// We are elsing |
|
218 | 225 | $else .= $before_shortcode; |
219 | 226 | } |
220 | 227 | |
@@ -238,9 +245,11 @@ discard block |
||
238 | 245 | } |
239 | 246 | |
240 | 247 | // Tack on the shortcode |
241 | - if ( ! $found ) { // We're still iffing. |
|
248 | + if ( ! $found ) { |
|
249 | +// We're still iffing. |
|
242 | 250 | $if .= $shortcode; |
243 | - } else { // We are elsing |
|
251 | + } else { |
|
252 | +// We are elsing |
|
244 | 253 | $else .= $shortcode; |
245 | 254 | } |
246 | 255 | } |
@@ -45,8 +45,7 @@ |
||
45 | 45 | * |
46 | 46 | * @return string |
47 | 47 | */ |
48 | - function random_bytes($bytes) |
|
49 | - { |
|
48 | + function random_bytes($bytes) { |
|
50 | 49 | /** @var resource $fp */ |
51 | 50 | static $fp = null; |
52 | 51 |
@@ -38,8 +38,7 @@ |
||
38 | 38 | * |
39 | 39 | * @return int |
40 | 40 | */ |
41 | - function random_int($min, $max) |
|
42 | - { |
|
41 | + function random_int($min, $max) { |
|
43 | 42 | /** |
44 | 43 | * Type and input logic checks |
45 | 44 | * |
@@ -40,8 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return string |
42 | 42 | */ |
43 | - function random_bytes($bytes) |
|
44 | - { |
|
43 | + function random_bytes($bytes) { |
|
45 | 44 | try { |
46 | 45 | /** @var int $bytes */ |
47 | 46 | $bytes = RandomCompat_intval($bytes); |
@@ -45,8 +45,7 @@ |
||
45 | 45 | * |
46 | 46 | * @throws TypeError |
47 | 47 | */ |
48 | - function RandomCompat_intval($number, $fail_open = false) |
|
49 | - { |
|
48 | + function RandomCompat_intval($number, $fail_open = false) { |
|
50 | 49 | if (is_int($number) || is_float($number)) { |
51 | 50 | $number += 0; |
52 | 51 | } elseif (is_numeric($number)) { |
@@ -208,8 +208,7 @@ |
||
208 | 208 | * @throws Exception |
209 | 209 | * @return string |
210 | 210 | */ |
211 | - function random_bytes($length) |
|
212 | - { |
|
211 | + function random_bytes($length) { |
|
213 | 212 | unset($length); // Suppress "variable not used" warnings. |
214 | 213 | throw new Exception( |
215 | 214 | 'There is no suitable CSPRNG installed on your system' |
@@ -28,21 +28,18 @@ |
||
28 | 28 | |
29 | 29 | if (!class_exists('Error', false)) { |
30 | 30 | // We can't really avoid making this extend Exception in PHP 5. |
31 | - class Error extends Exception |
|
32 | - { |
|
31 | + class Error extends Exception { |
|
33 | 32 | |
34 | 33 | } |
35 | 34 | } |
36 | 35 | |
37 | 36 | if (!class_exists('TypeError', false)) { |
38 | 37 | if (is_subclass_of('Error', 'Exception')) { |
39 | - class TypeError extends Error |
|
40 | - { |
|
38 | + class TypeError extends Error { |
|
41 | 39 | |
42 | 40 | } |
43 | 41 | } else { |
44 | - class TypeError extends Exception |
|
45 | - { |
|
42 | + class TypeError extends Exception { |
|
46 | 43 | |
47 | 44 | } |
48 | 45 | } |
@@ -44,8 +44,7 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @return int |
46 | 46 | */ |
47 | - function RandomCompat_strlen($binary_string) |
|
48 | - { |
|
47 | + function RandomCompat_strlen($binary_string) { |
|
49 | 48 | if (!is_string($binary_string)) { |
50 | 49 | throw new TypeError( |
51 | 50 | 'RandomCompat_strlen() expects a string' |
@@ -67,8 +66,7 @@ discard block |
||
67 | 66 | * |
68 | 67 | * @return int |
69 | 68 | */ |
70 | - function RandomCompat_strlen($binary_string) |
|
71 | - { |
|
69 | + function RandomCompat_strlen($binary_string) { |
|
72 | 70 | if (!is_string($binary_string)) { |
73 | 71 | throw new TypeError( |
74 | 72 | 'RandomCompat_strlen() expects a string' |
@@ -100,8 +98,7 @@ discard block |
||
100 | 98 | * |
101 | 99 | * @return string |
102 | 100 | */ |
103 | - function RandomCompat_substr($binary_string, $start, $length = null) |
|
104 | - { |
|
101 | + function RandomCompat_substr($binary_string, $start, $length = null) { |
|
105 | 102 | if (!is_string($binary_string)) { |
106 | 103 | throw new TypeError( |
107 | 104 | 'RandomCompat_substr(): First argument should be a string' |
@@ -158,8 +155,7 @@ discard block |
||
158 | 155 | * |
159 | 156 | * @return string |
160 | 157 | */ |
161 | - function RandomCompat_substr($binary_string, $start, $length = null) |
|
162 | - { |
|
158 | + function RandomCompat_substr($binary_string, $start, $length = null) { |
|
163 | 159 | if (!is_string($binary_string)) { |
164 | 160 | throw new TypeError( |
165 | 161 | 'RandomCompat_substr(): First argument should be a string' |