|
3 | 3 | namespace lloc\Msls;
|
4 | 4 |
|
5 | 5 | use lloc\Msls\Component\InputInterface;
|
| 6 | +use lloc\Msls\Component\Wrapper; |
6 | 7 | use lloc\Msls\ContentImport\MetaBox as ContentImportMetaBox;
|
7 | 8 |
|
8 | 9 | /**
|
@@ -225,13 +226,13 @@ public function render_select(): void {
|
225 | 226 |
|
226 | 227 | $post = $temp;
|
227 | 228 | } else {
|
228 |
| - printf( |
229 |
| - '<p>%s</p>', |
230 |
| - __( |
231 |
| - 'You should define at least another blog in a different language in order to have some benefit from this plugin!', |
232 |
| - 'multisite-language-switcher' |
233 |
| - ) |
| 229 | + $message = esc_html__( |
| 230 | + 'You should define at least another blog in a different language in order to have some benefit from this plugin!', |
| 231 | + 'multisite-language-switcher' |
234 | 232 | );
|
| 233 | + |
| 234 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 235 | + echo ( new Wrapper( 'p', $message ) )->render(); |
235 | 236 | }
|
236 | 237 | }
|
237 | 238 |
|
@@ -268,11 +269,13 @@ public function render_options( $type, $msls_id ): string {
|
268 | 269 | * @return string
|
269 | 270 | */
|
270 | 271 | public function render_option( int $post_id, int $msls_id ): string {
|
271 |
| - return sprintf( |
272 |
| - '<option value="%d" %s>%s</option>', |
273 |
| - esc_attr( $post_id ), |
274 |
| - selected( $post_id, $msls_id, false ), |
275 |
| - get_the_title( $post_id ) |
| 272 | + return wp_kses_post( |
| 273 | + sprintf( |
| 274 | + '<option value="%d" %s>%s</option>', |
| 275 | + esc_attr( $post_id ), |
| 276 | + selected( $post_id, $msls_id, false ), |
| 277 | + get_the_title( $post_id ) |
| 278 | + ) |
276 | 279 | );
|
277 | 280 | }
|
278 | 281 |
|
@@ -319,21 +322,23 @@ public function render_input(): void {
|
319 | 322 | restore_current_blog();
|
320 | 323 | }
|
321 | 324 |
|
322 |
| - printf( |
323 |
| - '<ul>%s</ul><input type="hidden" name="msls_post_type" id="msls_post_type" value="%s"/><input type="hidden" name="msls_action" id="msls_action" value="suggest_posts"/>', |
324 |
| - $items, |
325 |
| - $post_type |
| 325 | + echo wp_kses_post( |
| 326 | + sprintf( |
| 327 | + '<ul>%s</ul><input type="hidden" name="msls_post_type" id="msls_post_type" value="%s"/><input type="hidden" name="msls_action" id="msls_action" value="suggest_posts"/>', |
| 328 | + $items, |
| 329 | + $post_type |
| 330 | + ) |
326 | 331 | );
|
327 | 332 |
|
328 | 333 | $post = $temp;
|
329 | 334 | } else {
|
330 |
| - printf( |
331 |
| - '<p>%s</p>', |
332 |
| - __( |
333 |
| - 'You should define at least another blog in a different language in order to have some benefit from this plugin!', |
334 |
| - 'multisite-language-switcher' |
335 |
| - ) |
| 335 | + $message = esc_html__( |
| 336 | + 'You should define at least another blog in a different language in order to have some benefit from this plugin!', |
| 337 | + 'multisite-language-switcher' |
336 | 338 | );
|
| 339 | + |
| 340 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 341 | + echo ( new Wrapper( 'p', $message ) )->render(); |
337 | 342 | }
|
338 | 343 | }
|
339 | 344 |
|
|
0 commit comments