HEX
Server: Apache
System: Linux d5123.usc1.stableserver.net 5.14.0-570.17.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Sat May 24 12:53:17 EDT 2025 x86_64
User: d5123 (1001)
PHP: 8.4.21
Disabled: NONE
Upload Files
File: /home/d5123/myboofola_com/wp-content/plugins/connections/includes/Request/Integer_Array.php
<?php
/**
 * Get, validate, and sanitize an array of ID request variables.
 *
 * @since 10.4.17
 *
 * @category   WordPress\Plugin
 * @package    Connections Business Directory
 * @subpackage Connections\Request\Int Array
 * @author     Steven A. Zahm
 * @license    GPL-2.0+
 * @copyright  Copyright (c) 2022, Steven A. Zahm
 * @link       https://connections-pro.com/
 */

namespace Connections_Directory\Request;

/**
 * Class Int_Array
 *
 * @package Connections_Directory\Request
 */
class Integer_Array extends Input {

	/**
	 * The request filter.
	 *
	 * @since 10.4.17
	 *
	 * @var int
	 */
	protected $inputFilter = FILTER_VALIDATE_INT;

	/**
	 * The request filter/flag options.
	 *
	 * @since 10.4.17
	 *
	 * @var int
	 */
	protected $inputFilterOptions = FILTER_REQUIRE_ARRAY;

	/**
	 * The request variable key.
	 *
	 * @since 10.4.17
	 *
	 * @var string
	 */
	protected $key = '';

	/**
	 * The input schema.
	 *
	 * @since 10.4.17
	 *
	 * @var array
	 */
	protected $schema = array(
		'default' => array(),
		'type'    => 'array',
		'items'   => array(
			'type' => 'integer',
		),
	);

	/**
	 * ID constructor.
	 *
	 * @since 10.4.32
	 *
	 * @param string $key The request variable parameter.
	 */
	public function __construct( $key = '' ) {

		if ( is_string( $key ) && 0 < strlen( $key ) ) {

			$this->key = $key;
		}

		parent::__construct();
	}

	/**
	 * Sanitize the ID.
	 *
	 * @since 10.4.17
	 *
	 * @param int[] $unsafe The value to sanitize.
	 *
	 * @return int[]
	 */
	protected function sanitize( $unsafe ) {

		return array_map( 'absint', $unsafe );
	}

	/**
	 * Validate the ID.
	 *
	 * This is sufficiently validated against the schema, return `true`.
	 *
	 * @since 10.4.17
	 *
	 * @param string $unsafe The raw request value to validate.
	 *
	 * @return true
	 */
	protected function validate( $unsafe ) {

		return true;
	}
}