PHP 8.2.31
Preview: number.php Size: 1002 B
/home/nshryvcy/blissfulnepal.com/wp-content/plugins/wordfence-login-security/classes/utility/number.php

<?php

namespace WordfenceLS;

class Utility_Number {
	public static function isInteger($value, $min = null, $max = null) {
		$options = array();
		if ($min !== null)
			$options['min_range'] = $min;
		if ($max !== null)
			$options['max_range'] = $max;
		return filter_var($value, FILTER_VALIDATE_INT, array('options' => $options)) !== false;
	}

	public static function isUnixTimestamp($value) {
		return self::isInteger($value, 0);
	}
	
	/**
	 * Translates a value to a boolean, correctly interpreting various textual representations.
	 *
	 * @param $value
	 * @return bool
	 */
	public static function truthyToBool($value) {
		if ($value === true || $value === false) {
			return $value;
		}
		
		if (is_null($value)) {
			return false;
		}
		
		if (is_numeric($value)) {
			return !!$value;
		}
		
		if (preg_match('/^(?:f(?:alse)?|no?|off)$/i', $value)) {
			return false;
		}
		else if (preg_match('/^(?:t(?:rue)?|y(?:es)?|on)$/i', $value)) {
			return true;
		}
		
		return !empty($value);
	}
}

Directory Contents

Dirs: 0 × Files: 12

Name Size Perms Modified Actions
1.95 KB lrw-r--r-- 2026-05-06 14:06:06
Edit Download
417 B lrw-r--r-- 2026-05-06 14:06:06
Edit Download
2.08 KB lrw-r--r-- 2026-05-06 14:06:06
Edit Download
176 B lrw-r--r-- 2026-05-06 14:06:06
Edit Download
265 B lrw-r--r-- 2026-05-06 14:06:06
Edit Download
1.17 KB lrw-r--r-- 2026-05-06 14:06:06
Edit Download
2.14 KB lrw-r--r-- 2026-05-06 14:06:06
Edit Download
292 B lrw-r--r-- 2026-05-06 14:06:06
Edit Download
1002 B lrw-r--r-- 2026-05-06 14:06:06
Edit Download
817 B lrw-r--r-- 2026-05-06 14:06:06
Edit Download
613 B lrw-r--r-- 2026-05-06 14:06:06
Edit Download
1.01 KB lrw-r--r-- 2026-05-06 14:06:06
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).