HEX
Server: Apache
System: Linux andromeda.lojoweb.com 4.18.0-372.26.1.el8_6.x86_64 #1 SMP Tue Sep 13 06:07:14 EDT 2022 x86_64
User: nakedfoamlojoweb (1056)
PHP: 8.0.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/cwd/wp-content/plugins/redirection/models/redirect/redirect-options.php
<?php

/**
 * Options for a redirect source URL
 */
class Red_Source_Options {
	/**
	 * Exclude this from logging.
	 *
	 * @var boolean
	 */
	private $log_exclude = false;

	/**
	 * Constructor
	 *
	 * @param array|null $options Options.
	 */
	public function __construct( $options = null ) {
		if ( $options ) {
			$this->set_options( $options );
		}
	}

	/**
	 * Set options
	 *
	 * @param array $options Options.
	 * @return void
	 */
	public function set_options( $options ) {
		if ( isset( $options['log_exclude'] ) && $options['log_exclude'] === true ) {
			$this->log_exclude = true;
		}
	}

	/**
	 * Can this source be logged?
	 *
	 * @return boolean
	 */
	public function can_log() {
		$options = red_get_options();

		if ( isset( $options['expire_redirect'] ) && $options['expire_redirect'] !== -1 ) {
			return ! $this->log_exclude;
		}

		return false;
	}

	/**
	 * Get options as JSON
	 *
	 * @return array
	 */
	public function get_json() {
		return array_filter( [
			'log_exclude' => $this->log_exclude,
		] );
	}
}