HEX
Server: Apache
System: Linux srv674466.hstgr.cloud 5.14.0-503.19.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jan 7 17:08:27 EST 2025 x86_64
User: rialindia (1055)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/rialindia/public_html/wp-content/plugins/popup-maker/classes/Utils/Time.php
<?php
/**
 * Time Utility
 *
 * @package   PopupMaker
 * @copyright Copyright (c) 2024, Code Atlantic LLC
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class PUM_Utils_Time
 */
class PUM_Utils_Time {

	/**
	 * Check if a value is a valid Unix timestamp.
	 *
	 * Validates whether the input represents a valid Unix timestamp.
	 * A valid timestamp must be a positive integer (as string or int).
	 * Unix timestamps are positive integers representing seconds since 1970-01-01 00:00:00 UTC.
	 *
	 * @param int|string $timestamp Value to check for timestamp validity (accepts numeric strings)
	 * @return bool True if the value is a valid Unix timestamp, false otherwise
	 */
	public static function is_timestamp( $timestamp ) {
		return ( 1 === preg_match( '~^[1-9][0-9]*$~', (string) $timestamp ) );
	}
}