Skip to content

Commit c2283a2

Browse files
committed
Reformatting
1 parent 7db782e commit c2283a2

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

includes/MslsMetaBox.php

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace lloc\Msls;
44

55
use lloc\Msls\Component\InputInterface;
6+
use lloc\Msls\Component\Wrapper;
67
use lloc\Msls\ContentImport\MetaBox as ContentImportMetaBox;
78

89
/**
@@ -225,13 +226,13 @@ public function render_select(): void {
225226

226227
$post = $temp;
227228
} 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'
234232
);
233+
234+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
235+
echo ( new Wrapper( 'p', $message ) )->render();
235236
}
236237
}
237238

@@ -268,11 +269,13 @@ public function render_options( $type, $msls_id ): string {
268269
* @return string
269270
*/
270271
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+
)
276279
);
277280
}
278281

@@ -319,21 +322,23 @@ public function render_input(): void {
319322
restore_current_blog();
320323
}
321324

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+
)
326331
);
327332

328333
$post = $temp;
329334
} 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'
336338
);
339+
340+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
341+
echo ( new Wrapper( 'p', $message ) )->render();
337342
}
338343
}
339344

0 commit comments

Comments
 (0)