Code Duplication    Length = 4-4 lines in 2 locations

includes/shortcodes/class-wc-shortcode-checkout.php 1 location

@@ 88-91 (lines=4) @@
85
			$order_key            = $_GET[ 'key' ];
86
			$order                = wc_get_order( $order_id );
87
88
			if ( ! current_user_can( 'pay_for_order', $order_id ) ) {
89
				echo '<div class="woocommerce-error">' . __( 'Invalid order. If you have an account please log in and try again.', 'woocommerce' ) . ' <a href="' . wc_get_page_permalink( 'myaccount' ) . '" class="wc-forward">' . __( 'My Account', 'woocommerce' ) . '</a>' . '</div>';
90
				return;
91
			}
92
93
			if ( $order->id == $order_id && $order->order_key == $order_key ) {
94

includes/shortcodes/class-wc-shortcode-my-account.php 1 location

@@ 93-96 (lines=4) @@
90
		$user_id = get_current_user_id();
91
		$order   = wc_get_order( $order_id );
92
93
		if ( ! current_user_can( 'view_order', $order_id ) ) {
94
			echo '<div class="woocommerce-error">' . __( 'Invalid order.', 'woocommerce' ) . ' <a href="' . wc_get_page_permalink( 'myaccount' ).'" class="wc-forward">'. __( 'My Account', 'woocommerce' ) .'</a>' . '</div>';
95
			return;
96
		}
97
98
		// Backwards compatibility
99
		$status       = new stdClass();