HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: /home/goremar3/public_html/wp-content/plugins/shopengine/modules/comparison/comparison-share.php
<?php


namespace ShopEngine\Modules\Comparison;


class Comparison_Share {

	public static function init() {
		// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- It's a fronted user part, not possible to verify nonce here
		$product_ids = !empty( $_GET['product_ids'] ) ? explode( ',', sanitize_text_field( wp_unslash( $_GET['product_ids'] ) ) ?? '' ) : [];

		if ( empty( $product_ids ) ) {
			// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- It's a fronted user part, not possible to verify nonce here
			$existing_comparison_products = empty( $_COOKIE[ Comparison::COOKIE_KEY ] ) ? '' : sanitize_text_field( wp_unslash( $_COOKIE[ Comparison::COOKIE_KEY ] ) );
			$product_ids                  = $existing_comparison_products? explode( ',', $existing_comparison_products ) : [];

		} else {
			setcookie(
				Comparison::COOKIE_KEY,
				implode( ',', $product_ids ),
				strtotime( '+' . Comparison::COOKIE_TIME_IN_DAYS . ' days' ), '/'
			);
		}

		get_header();
		?>
		<div class="shopengine-comparison-page">
			<div class="comparison-page-inner">
				<?php
				if ( empty( $product_ids ) ) {
					echo '<h1 class="shopengine-no-comparison-product">' . esc_html__( 'No product is added for comparison, please add some product to compare', 'shopengine' ) . '</h1>';
				} else {
					Comparison_Helper::get_html( $product_ids, true );
				}
				?>
			</div>
		</div>
		<?php get_footer();
	}

}