@@ -75,35 +75,35 @@ |
||
75 | 75 | for( $i = 0; $i < count( $rule ); ++$i ) { |
76 | 76 | if ( $rule[$i] && ( !isset( $call['args'][$i] ) || !is_string( $call['args'][$i] ) || '' == $call['args'][$i] ) ) return false; |
77 | 77 | switch( $rule[$i] ) { |
78 | - case 'string': |
|
79 | - if ( $complete ) { |
|
80 | - $multiple[] = $entry; |
|
81 | - $entry = new Translation_Entry; |
|
82 | - $complete = false; |
|
83 | - } |
|
84 | - $entry->singular = $call['args'][$i]; |
|
85 | - $complete = true; |
|
86 | - break; |
|
87 | - case 'singular': |
|
88 | - if ( $complete ) { |
|
89 | - $multiple[] = $entry; |
|
90 | - $entry = new Translation_Entry; |
|
91 | - $complete = false; |
|
92 | - } |
|
93 | - $entry->singular = $call['args'][$i]; |
|
94 | - $entry->is_plural = true; |
|
95 | - break; |
|
96 | - case 'plural': |
|
97 | - $entry->plural = $call['args'][$i]; |
|
98 | - $entry->is_plural = true; |
|
99 | - $complete = true; |
|
100 | - break; |
|
101 | - case 'context': |
|
102 | - $entry->context = $call['args'][$i]; |
|
103 | - foreach( $multiple as &$single_entry ) { |
|
104 | - $single_entry->context = $entry->context; |
|
105 | - } |
|
106 | - break; |
|
78 | + case 'string': |
|
79 | + if ( $complete ) { |
|
80 | + $multiple[] = $entry; |
|
81 | + $entry = new Translation_Entry; |
|
82 | + $complete = false; |
|
83 | + } |
|
84 | + $entry->singular = $call['args'][$i]; |
|
85 | + $complete = true; |
|
86 | + break; |
|
87 | + case 'singular': |
|
88 | + if ( $complete ) { |
|
89 | + $multiple[] = $entry; |
|
90 | + $entry = new Translation_Entry; |
|
91 | + $complete = false; |
|
92 | + } |
|
93 | + $entry->singular = $call['args'][$i]; |
|
94 | + $entry->is_plural = true; |
|
95 | + break; |
|
96 | + case 'plural': |
|
97 | + $entry->plural = $call['args'][$i]; |
|
98 | + $entry->is_plural = true; |
|
99 | + $complete = true; |
|
100 | + break; |
|
101 | + case 'context': |
|
102 | + $entry->context = $call['args'][$i]; |
|
103 | + foreach( $multiple as &$single_entry ) { |
|
104 | + $single_entry->context = $entry->context; |
|
105 | + } |
|
106 | + break; |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | if ( isset( $call['line'] ) && $call['line'] ) { |
@@ -203,36 +203,36 @@ |
||
203 | 203 | |
204 | 204 | if ( isset($_GET['update']) ) : |
205 | 205 | switch($_GET['update']) { |
206 | - case 'adduser': |
|
207 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>'; |
|
208 | - break; |
|
209 | - case 'err_add_member': |
|
210 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>'; |
|
211 | - break; |
|
212 | - case 'err_add_notfound': |
|
213 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>'; |
|
214 | - break; |
|
215 | - case 'promote': |
|
216 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; |
|
217 | - break; |
|
218 | - case 'err_promote': |
|
219 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>'; |
|
220 | - break; |
|
221 | - case 'remove': |
|
222 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>'; |
|
223 | - break; |
|
224 | - case 'err_remove': |
|
225 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>'; |
|
226 | - break; |
|
227 | - case 'newuser': |
|
228 | - echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>'; |
|
229 | - break; |
|
230 | - case 'err_new': |
|
231 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>'; |
|
232 | - break; |
|
233 | - case 'err_new_dup': |
|
234 | - echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>'; |
|
235 | - break; |
|
206 | + case 'adduser': |
|
207 | + echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>'; |
|
208 | + break; |
|
209 | + case 'err_add_member': |
|
210 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>'; |
|
211 | + break; |
|
212 | + case 'err_add_notfound': |
|
213 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>'; |
|
214 | + break; |
|
215 | + case 'promote': |
|
216 | + echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; |
|
217 | + break; |
|
218 | + case 'err_promote': |
|
219 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>'; |
|
220 | + break; |
|
221 | + case 'remove': |
|
222 | + echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>'; |
|
223 | + break; |
|
224 | + case 'err_remove': |
|
225 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>'; |
|
226 | + break; |
|
227 | + case 'newuser': |
|
228 | + echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>'; |
|
229 | + break; |
|
230 | + case 'err_new': |
|
231 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>'; |
|
232 | + break; |
|
233 | + case 'err_new_dup': |
|
234 | + echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>'; |
|
235 | + break; |
|
236 | 236 | } |
237 | 237 | endif; ?> |
238 | 238 |
@@ -156,12 +156,12 @@ |
||
156 | 156 | } else { |
157 | 157 | $ext = '.jpg'; |
158 | 158 | switch ( $metadata['image']['mime'] ) { |
159 | - case 'image/gif': |
|
160 | - $ext = '.gif'; |
|
161 | - break; |
|
162 | - case 'image/png': |
|
163 | - $ext = '.png'; |
|
164 | - break; |
|
159 | + case 'image/gif': |
|
160 | + $ext = '.gif'; |
|
161 | + break; |
|
162 | + case 'image/png': |
|
163 | + $ext = '.png'; |
|
164 | + break; |
|
165 | 165 | } |
166 | 166 | $basename = str_replace( '.', '-', basename( $file ) ) . '-image' . $ext; |
167 | 167 | $uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] ); |
@@ -354,24 +354,24 @@ |
||
354 | 354 | */ |
355 | 355 | function sanitize_bookmark_field($field, $value, $bookmark_id, $context) { |
356 | 356 | switch ( $field ) { |
357 | - case 'link_id' : // ints |
|
358 | - case 'link_rating' : |
|
359 | - $value = (int) $value; |
|
360 | - break; |
|
361 | - case 'link_category' : // array( ints ) |
|
362 | - $value = array_map('absint', (array) $value); |
|
363 | - // We return here so that the categories aren't filtered. |
|
364 | - // The 'link_category' filter is for the name of a link category, not an array of a link's link categories |
|
365 | - return $value; |
|
366 | - |
|
367 | - case 'link_visible' : // bool stored as Y|N |
|
368 | - $value = preg_replace('/[^YNyn]/', '', $value); |
|
369 | - break; |
|
370 | - case 'link_target' : // "enum" |
|
371 | - $targets = array('_top', '_blank'); |
|
372 | - if ( ! in_array($value, $targets) ) |
|
373 | - $value = ''; |
|
374 | - break; |
|
357 | + case 'link_id' : // ints |
|
358 | + case 'link_rating' : |
|
359 | + $value = (int) $value; |
|
360 | + break; |
|
361 | + case 'link_category' : // array( ints ) |
|
362 | + $value = array_map('absint', (array) $value); |
|
363 | + // We return here so that the categories aren't filtered. |
|
364 | + // The 'link_category' filter is for the name of a link category, not an array of a link's link categories |
|
365 | + return $value; |
|
366 | + |
|
367 | + case 'link_visible' : // bool stored as Y|N |
|
368 | + $value = preg_replace('/[^YNyn]/', '', $value); |
|
369 | + break; |
|
370 | + case 'link_target' : // "enum" |
|
371 | + $targets = array('_top', '_blank'); |
|
372 | + if ( ! in_array($value, $targets) ) |
|
373 | + $value = ''; |
|
374 | + break; |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | if ( 'raw' == $context ) |
@@ -2440,15 +2440,15 @@ discard block |
||
2440 | 2440 | } |
2441 | 2441 | $errors = $message->get_error_messages(); |
2442 | 2442 | switch ( count( $errors ) ) { |
2443 | - case 0 : |
|
2444 | - $message = ''; |
|
2445 | - break; |
|
2446 | - case 1 : |
|
2447 | - $message = "<p>{$errors[0]}</p>"; |
|
2448 | - break; |
|
2449 | - default : |
|
2450 | - $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>"; |
|
2451 | - break; |
|
2443 | + case 0 : |
|
2444 | + $message = ''; |
|
2445 | + break; |
|
2446 | + case 1 : |
|
2447 | + $message = "<p>{$errors[0]}</p>"; |
|
2448 | + break; |
|
2449 | + default : |
|
2450 | + $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>"; |
|
2451 | + break; |
|
2452 | 2452 | } |
2453 | 2453 | } elseif ( is_string( $message ) ) { |
2454 | 2454 | $message = "<p>$message</p>"; |
@@ -4447,17 +4447,17 @@ discard block |
||
4447 | 4447 | */ |
4448 | 4448 | function _wp_mysql_week( $column ) { |
4449 | 4449 | switch ( $start_of_week = (int) get_option( 'start_of_week' ) ) { |
4450 | - case 1 : |
|
4451 | - return "WEEK( $column, 1 )"; |
|
4452 | - case 2 : |
|
4453 | - case 3 : |
|
4454 | - case 4 : |
|
4455 | - case 5 : |
|
4456 | - case 6 : |
|
4457 | - return "WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )"; |
|
4458 | - case 0 : |
|
4459 | - default : |
|
4460 | - return "WEEK( $column, 0 )"; |
|
4450 | + case 1 : |
|
4451 | + return "WEEK( $column, 1 )"; |
|
4452 | + case 2 : |
|
4453 | + case 3 : |
|
4454 | + case 4 : |
|
4455 | + case 5 : |
|
4456 | + case 6 : |
|
4457 | + return "WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )"; |
|
4458 | + case 0 : |
|
4459 | + default : |
|
4460 | + return "WEEK( $column, 0 )"; |
|
4461 | 4461 | } |
4462 | 4462 | } |
4463 | 4463 |
@@ -5208,18 +5208,18 @@ |
||
5208 | 5208 | } |
5209 | 5209 | |
5210 | 5210 | switch ( $type ) { |
5211 | - case 'image': |
|
5212 | - $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ); |
|
5213 | - return in_array( $ext, $image_exts ); |
|
5211 | + case 'image': |
|
5212 | + $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ); |
|
5213 | + return in_array( $ext, $image_exts ); |
|
5214 | 5214 | |
5215 | - case 'audio': |
|
5216 | - return in_array( $ext, wp_get_audio_extensions() ); |
|
5215 | + case 'audio': |
|
5216 | + return in_array( $ext, wp_get_audio_extensions() ); |
|
5217 | 5217 | |
5218 | - case 'video': |
|
5219 | - return in_array( $ext, wp_get_video_extensions() ); |
|
5218 | + case 'video': |
|
5219 | + return in_array( $ext, wp_get_video_extensions() ); |
|
5220 | 5220 | |
5221 | - default: |
|
5222 | - return $type === $ext; |
|
5221 | + default: |
|
5222 | + return $type === $ext; |
|
5223 | 5223 | } |
5224 | 5224 | } |
5225 | 5225 |
@@ -91,29 +91,29 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | switch ($match[3]) { |
94 | - case 'd': |
|
95 | - // deleted lines |
|
96 | - array_push($edits, |
|
97 | - new Text_Diff_Op_delete( |
|
98 | - $this->_getLines($from_lines, $from_line_no, $match[2]))); |
|
99 | - $to_line_no++; |
|
100 | - break; |
|
101 | - |
|
102 | - case 'c': |
|
103 | - // changed lines |
|
104 | - array_push($edits, |
|
105 | - new Text_Diff_Op_change( |
|
106 | - $this->_getLines($from_lines, $from_line_no, $match[2]), |
|
107 | - $this->_getLines($to_lines, $to_line_no, $match[5]))); |
|
108 | - break; |
|
109 | - |
|
110 | - case 'a': |
|
111 | - // added lines |
|
112 | - array_push($edits, |
|
113 | - new Text_Diff_Op_add( |
|
114 | - $this->_getLines($to_lines, $to_line_no, $match[5]))); |
|
115 | - $from_line_no++; |
|
116 | - break; |
|
94 | + case 'd': |
|
95 | + // deleted lines |
|
96 | + array_push($edits, |
|
97 | + new Text_Diff_Op_delete( |
|
98 | + $this->_getLines($from_lines, $from_line_no, $match[2]))); |
|
99 | + $to_line_no++; |
|
100 | + break; |
|
101 | + |
|
102 | + case 'c': |
|
103 | + // changed lines |
|
104 | + array_push($edits, |
|
105 | + new Text_Diff_Op_change( |
|
106 | + $this->_getLines($from_lines, $from_line_no, $match[2]), |
|
107 | + $this->_getLines($to_lines, $to_line_no, $match[5]))); |
|
108 | + break; |
|
109 | + |
|
110 | + case 'a': |
|
111 | + // added lines |
|
112 | + array_push($edits, |
|
113 | + new Text_Diff_Op_add( |
|
114 | + $this->_getLines($to_lines, $to_line_no, $match[5]))); |
|
115 | + $from_line_no++; |
|
116 | + break; |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 |
@@ -44,17 +44,17 @@ |
||
44 | 44 | continue; |
45 | 45 | } |
46 | 46 | switch ($line[0]) { |
47 | - case ' ': |
|
48 | - $edits[] = new Text_Diff_Op_copy(array(substr($line, 1))); |
|
49 | - break; |
|
47 | + case ' ': |
|
48 | + $edits[] = new Text_Diff_Op_copy(array(substr($line, 1))); |
|
49 | + break; |
|
50 | 50 | |
51 | - case '+': |
|
52 | - $edits[] = new Text_Diff_Op_add(array(substr($line, 1))); |
|
53 | - break; |
|
51 | + case '+': |
|
52 | + $edits[] = new Text_Diff_Op_add(array(substr($line, 1))); |
|
53 | + break; |
|
54 | 54 | |
55 | - case '-': |
|
56 | - $edits[] = new Text_Diff_Op_delete(array(substr($line, 1))); |
|
57 | - break; |
|
55 | + case '-': |
|
56 | + $edits[] = new Text_Diff_Op_delete(array(substr($line, 1))); |
|
57 | + break; |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 |
@@ -154,21 +154,21 @@ |
||
154 | 154 | |
155 | 155 | foreach ($edits as $edit) { |
156 | 156 | switch (strtolower(get_class($edit))) { |
157 | - case 'text_diff_op_copy': |
|
158 | - $output .= $this->_context($edit->orig); |
|
159 | - break; |
|
157 | + case 'text_diff_op_copy': |
|
158 | + $output .= $this->_context($edit->orig); |
|
159 | + break; |
|
160 | 160 | |
161 | - case 'text_diff_op_add': |
|
162 | - $output .= $this->_added($edit->final); |
|
163 | - break; |
|
161 | + case 'text_diff_op_add': |
|
162 | + $output .= $this->_added($edit->final); |
|
163 | + break; |
|
164 | 164 | |
165 | - case 'text_diff_op_delete': |
|
166 | - $output .= $this->_deleted($edit->orig); |
|
167 | - break; |
|
165 | + case 'text_diff_op_delete': |
|
166 | + $output .= $this->_deleted($edit->orig); |
|
167 | + break; |
|
168 | 168 | |
169 | - case 'text_diff_op_change': |
|
170 | - $output .= $this->_changed($edit->orig, $edit->final); |
|
171 | - break; |
|
169 | + case 'text_diff_op_change': |
|
170 | + $output .= $this->_changed($edit->orig, $edit->final); |
|
171 | + break; |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 |