-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some sanitization back in #120
Conversation
// Enqueue scripts and styles on the edit screen of the Block post type. | ||
if ( $this->slug === $page ) { | ||
if ( filter_input( INPUT_GET, 'page' ) === $this->slug ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this isn't sanitized, there shouldn't be a variable $page
that can be used for anything.
filter_input()
should just run inline.
@@ -53,7 +53,7 @@ public function validate( $value, $echo ) { | |||
$content = genesis_custom_blocks()->loader->get_data( 'content' ); | |||
|
|||
return empty( $content ) | |||
? urldecode( filter_input( INPUT_GET, 'inner_blocks' ) ) | |||
? urldecode( wp_strip_all_tags( filter_input( INPUT_GET, 'inner_blocks' ) ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wp_strip_all_tags()
is similar to what the FILTER_SANITIZE_STRING
argument did before I deleted it
$context = filter_input( INPUT_GET, 'context' ); | ||
|
||
if ( 'edit' === $context ) { | ||
if ( 'edit' === filter_input( INPUT_GET, 'context' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to above, because filter_input()
isn't sanitizing, it shouldn't be stored in the variable $context
, which can be used anywhere.
filter_input()
should simply run inline.
With this and #119, GCB free looks to be compatible with PHP Though WP And Core might have more changes before the |
Hi @dreamwhisper, |
Background
In #119, I removed
FILTER_SANITIZE_STRING
flags for PHP 8.1 compatibilityChanges
Testing instructions
Not needed, just a sanity check would be great