Skip to content

Commit 1b26658

Browse files
committed
early escape no output buffering
Signed-off-by: Andy Fragen <andy@thefragens.com>
1 parent 7a3a3b1 commit 1b26658

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

inc/packages/admin/class-list-table.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@ class List_Table extends WP_Plugin_Install_List_Table {
2222
* @return void
2323
*/
2424
public function views() {
25-
ob_start();
26-
parent::views();
27-
$views = ob_get_clean();
28-
2925
// For WP versions prior to 6.9.0, do not modify views.
3026
if ( ! is_wp_version_compatible( '6.9' ) ) {
31-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Replacements are escaped. The previous content is direct from Core.
32-
echo $views;
27+
parent::views();
3328
return;
3429
}
3530

31+
ob_start();
32+
parent::views();
33+
$views = ob_get_clean();
34+
3635
preg_match( '|<a href="(?<url>[^"]+)">(?<text>[^>]+)<\/a>|', $views, $matches );
3736
if ( ! empty( $matches['text'] ) ) {
3837
$text_with_fair = str_replace( 'WordPress', 'FAIR', $matches['text'] );

0 commit comments

Comments
 (0)