Skip to content

Commit

Permalink
Prevent notice about forced not being defined in get_validation_error…
Browse files Browse the repository at this point in the history
…_sanitization
  • Loading branch information
westonruter committed Jun 1, 2018
1 parent 2b089f3 commit decebc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/validation/class-amp-invalid-url-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ public static function filter_row_actions( $actions, $post ) {

$actions[ self::RECHECK_ACTION ] = sprintf(
'<a href="%s">%s</a>',
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' )
);

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit decebc2

Please sign in to comment.