summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/class.jetpack-twitter-cards.php')
-rw-r--r--plugins/jetpack/class.jetpack-twitter-cards.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/jetpack/class.jetpack-twitter-cards.php b/plugins/jetpack/class.jetpack-twitter-cards.php
index d8b286f3..5f3e1f6d 100644
--- a/plugins/jetpack/class.jetpack-twitter-cards.php
+++ b/plugins/jetpack/class.jetpack-twitter-cards.php
@@ -330,8 +330,8 @@ class Jetpack_Twitter_Cards {
* Validate the settings submission.
*/
public static function settings_validate() {
- if ( wp_verify_nonce( $_POST['jetpack_twitter_cards_nonce'], 'jetpack-twitter-cards-settings' ) ) {
- update_option( 'jetpack-twitter-cards-site-tag', trim( ltrim( wp_strip_all_tags( $_POST['jetpack-twitter-cards-site-tag'] ), '@' ) ) );
+ if ( isset( $_POST['jetpack_twitter_cards_nonce'] ) && wp_verify_nonce( $_POST['jetpack_twitter_cards_nonce'], 'jetpack-twitter-cards-settings' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
+ update_option( 'jetpack-twitter-cards-site-tag', isset( $_POST['jetpack-twitter-cards-site-tag'] ) ? trim( ltrim( wp_strip_all_tags( filter_var( wp_unslash( $_POST['jetpack-twitter-cards-site-tag'] ) ) ), '@' ) ) : '' );
}
}
@@ -339,7 +339,7 @@ class Jetpack_Twitter_Cards {
* Initiates the class.
*/
public static function init() {
- add_filter( 'jetpack_open_graph_tags', array( __CLASS__, 'twitter_cards_tags' ) );
+ add_filter( 'jetpack_open_graph_tags', array( __CLASS__, 'twitter_cards_tags' ), 11 ); // $priority=11: this should hook into jetpack_open_graph_tags after 'class.jetpack-seo.php' has done so.
add_filter( 'jetpack_open_graph_output', array( __CLASS__, 'twitter_cards_output' ) );
add_filter( 'jetpack_twitter_cards_site_tag', array( __CLASS__, 'site_tag' ), -99 );
add_filter( 'jetpack_twitter_cards_site_tag', array( __CLASS__, 'prioritize_creator_over_default_site' ), 99, 2 );