<?php
/**
* Represents a measurable length, with a string numeric magnitude
* and a unit. This object is immutable.
*/
class HTMLPurifier_Length
{
/**
* String numeric magnitude.
* @type string
*/
protected $n;
/**
* String unit. False is permitted if $n = 0.
* @type string|bool
*/
protected $unit;
/**
* Whether or not this length is valid. Null if not calculated yet.
* @type bool
*/
protected $isValid;
/**
* Array Lookup array of units recognized by CSS 3
* @type array
*/
protected static $allowedUnits = array(
'em' => true, 'ex' => true, 'px' => true, 'in' => true,
'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true,
'ch' => true, 'rem' => true, 'vw' => true, 'vh' => true,
'vmin' => true, 'vmax' => true
);
/**
* @param string $n Magnitude
* @param bool|string $u Unit
*/
public function __construct($n = '0', $u = false)
{
$this->n = (string) $n;
$this->unit = $u !== false ? (string) $u : false;
}
/**
* @param string $s Unit string, like '2em' or '3.4in'
* @return HTMLPurifier_Length
* @warning Does not perform validation.
*/
public static function make($s)
{
if ($s instanceof HTMLPurifier_Length) {
return $s;
}
$n_length = strspn($s, '1234567890.+-');
$n = substr($s, 0, $n_length);
$unit = substr($s, $n_length);
if ($unit === '') {
$unit = false;
}
return new HTMLPurifier_Length($n, $unit);
}
/**
* Validates the number and unit.
* @return bool
*/
protected function validate()
{
// Special case:
if ($this->n === '+0' || $this->n === '-0') {
$this->n = '0';
}
if ($this->n === '0' && $this->unit === false) {
return true;
}
if ($this->unit === false || !ctype_lower($this->unit)) {
$this->unit = strtolower($this->unit);
}
if (!isset(HTMLPurifier_Length::$allowedUnits[$this->unit])) {
return false;
}
// Hack:
$def = new HTMLPurifier_AttrDef_CSS_Number();
$result = $def->validate($this->n, false, false);
if ($result === false) {
return false;
}
$this->n = $result;
return true;
}
/**
* Returns string representation of number.
* @return string
*/
public function toString()
{
if (!$this->isValid()) {
return false;
}
return $this->n . $this->unit;
}
/**
* Retrieves string numeric magnitude.
* @return string
*/
public function getN()
{
return $this->n;
}
/**
* Retrieves string unit.
* @return string
*/
public function getUnit()
{
return $this->unit;
}
/**
* Returns true if this length unit is valid.
* @return bool
*/
public function isValid()
{
if ($this->isValid === null) {
$this->isValid = $this->validate();
}
return $this->isValid;
}
/**
* Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.
* @param HTMLPurifier_Length $l
* @return int
* @warning If both values are too large or small, this calculation will
* not work properly
*/
public function compareTo($l)
{
if ($l === false) {
return false;
}
if ($l->unit !== $this->unit) {
$converter = new HTMLPurifier_UnitConverter();
$l = $converter->convert($l, $this->unit);
if ($l === false) {
return false;
}
}
return $this->n - $l->n;
}
}
// vim: et sw=4 sts=4
At NFC Pay, your privacy is of utmost importance to us. This Privacy Policy outlines how we collect, use, share, and protect your personal information when you use our services, including our website and mobile applications.
1. Information We Collect
2. How We Use Your Information
We use the information we collect for the following purposes:
3. Sharing Your Information
We may share your personal information in the following circumstances:
4. Security of Your Information
We take the security of your personal information seriously and implement a variety of security measures, including encryption, secure servers, and access controls, to protect your data from unauthorized access, disclosure, alteration, or destruction. However, no method of transmission over the internet or electronic storage is completely secure, and we cannot guarantee its absolute security.
5. Your Privacy Rights
Depending on your location, you may have certain rights regarding your personal information, such as:
6. Third-Party Links
Our services may contain links to third-party websites or services. We are not responsible for the privacy practices or the content of these third-party sites. We encourage you to review the privacy policies of those third parties.
7. Children’s Privacy
Our services are not intended for individuals under the age of 13. We do not knowingly collect personal information from children under 13. If we become aware that we have collected personal information from a child under 13, we will take steps to delete that information.
8. Changes to This Privacy Policy
We may update this Privacy Policy from time to time to reflect changes in our practices or for other operational, legal, or regulatory reasons. We will notify you of any significant changes by posting the new Privacy Policy on our website and updating the effective date.
9. Contact Us
If you have any questions or concerns about this Privacy Policy or our data practices, please contact us at:
Email: support@nfcpay.com