style: move phpcs:ignore to echo output line for PHPCS compliance
EscapeOutput sniff fires on the argument line of multi-line printf, not the call site. Collapse to single-line echo so the phpcs:ignore inline comment covers the offending expression. No functional change. Agent-Session: prcore-jsonld-remediation-20260623
This commit is contained in:
@@ -210,11 +210,7 @@ class PR_Core_Jsonld_Article {
|
||||
JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT
|
||||
);
|
||||
if ( false !== $json ) {
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_json_encode() is the canonical JSON escape; no further escaping needed.
|
||||
printf(
|
||||
'<script type="application/ld+json">%s</script>' . "\n",
|
||||
$json
|
||||
);
|
||||
echo '<script type="application/ld+json">' . $json . '</script>' . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_json_encode() already escapes for JSON context.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user