From decebc24cc64883ba2dd9185e7d5932536d09fc7 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 1 Jun 2018 12:44:03 -0700 Subject: [PATCH] Prevent notice about forced not being defined in get_validation_error_sanitization --- includes/validation/class-amp-invalid-url-post-type.php | 4 ++-- includes/validation/class-amp-validation-error-taxonomy.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/validation/class-amp-invalid-url-post-type.php b/includes/validation/class-amp-invalid-url-post-type.php index d16dda6afc9..8504a36ffce 100644 --- a/includes/validation/class-amp-invalid-url-post-type.php +++ b/includes/validation/class-amp-invalid-url-post-type.php @@ -616,7 +616,7 @@ public static function filter_row_actions( $actions, $post ) { $actions[ self::RECHECK_ACTION ] = sprintf( '%s', - self::get_recheck_url( $post, get_edit_post_link( $post->ID, 'raw' ) ), + esc_url( self::get_recheck_url( $post, get_edit_post_link( $post->ID, 'raw' ) ) ), esc_html__( 'Re-check', 'amp' ) ); @@ -807,7 +807,7 @@ public static function handle_validation_error_status_update() { return; } $post = get_post(); - if ( ! $post || self::POST_TYPE_SLUG !== get_post_type( $post ) ) { + if ( ! $post || self::POST_TYPE_SLUG !== $post->post_type ) { return; } $updated_count = 0; diff --git a/includes/validation/class-amp-validation-error-taxonomy.php b/includes/validation/class-amp-validation-error-taxonomy.php index 36b193f5e8a..381e415ca4d 100644 --- a/includes/validation/class-amp-validation-error-taxonomy.php +++ b/includes/validation/class-amp-validation-error-taxonomy.php @@ -237,6 +237,7 @@ public static function get_validation_error_sanitization( $error ) { */ $sanitized = apply_filters( 'amp_validation_error_sanitized', null, $error ); + $forced = false; if ( null !== $sanitized ) { $forced = true; $status = $sanitized ? self::VALIDATION_ERROR_ACCEPTED_STATUS : self::VALIDATION_ERROR_REJECTED_STATUS;