/trunk/phpstan.neon.dist |
---|
File deleted |
/trunk/oid_utils.inc.phps |
---|
2,8 → 2,8 |
/* |
* OID-Utilities for PHP |
* Copyright 2011-2022 Daniel Marschall, ViaThinkSoft |
* Version 2022-01-07 |
* Copyright 2011-2021 Daniel Marschall, ViaThinkSoft |
* Version 2021-09-23 |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
333,15 → 333,14 |
* @version 2015-08-17 |
* @param string $oid<br/> |
* An OID in dot notation. |
* @param mixed $leading_dot<br/> |
* @param boolean $leading_dot<br/> |
* true: The OID is valid, if it contains a leading dot.<br/> |
* false (default): The OID is valid, if it does not contain a leading dot. |
* 'auto: Allow both |
* @return string|false The OID without leading dots, or <code>false</code> if the OID is syntactically wrong. |
**/ |
$oid_sanitize_cache = array(); |
function sanitizeOID($oid, $leading_dot=false) { |
static $oid_sanitize_cache = array(); |
if ($leading_dot) $leading_dot = substr($oid,0,1) == '.'; |
// We are using a cache, since this function is used very often by OIDplus |
363,7 → 362,7 |
continue; |
} |
if (!preg_match('@^(\\d+)$@', $a, $m)) return false; // does contain something other than digits |
if (!ctype_digit($a)) return false; // does contain something other than digits |
// strike leading zeroes |
$a = preg_replace("@^0+@", '', $a); |
/trunk/oidinfo_api.inc.phps |
---|
397,9 → 397,6 |
$desc = preg_replace("@ OID$@i", '', $desc); |
$desc = preg_replace("@ OID Namespace$@i", '', $desc); |
$desc = preg_replace("@^OID for @i", '', $desc); |
$desc = preg_replace("@OID root$@i", '', $desc); |
$desc = preg_replace("@Object Identifier$@i", '', $desc); |
$desc = preg_replace("@^The @i", '', $desc); |
$desc = rtrim($desc); |
if ($ending_dot_policy == self::OIDINFO_CORRECT_DESC_ENFORCE_ENDING_DOT) { |
408,9 → 405,6 |
$desc = preg_replace('@\\.$@', '', $desc); |
} |
// Required for XML importer of oid-info.com (E-Mail 09.12.2021) |
$desc = str_replace('&', '&amp;', $desc); |
return $desc; |
} |
/trunk/oidinfo_test.phps |
---|
34,6 → 34,6 |
assert($oa->illegalOID('2.25.340282366920938463463374607431768211455') === false); |
assert($oa->illegalOID('2.25.340282366920938463463374607431768211456') === true); |
assert($oa->strictCheckSyntax('0') === true); |
assert($oa->strictCheckSyntax('1') === true); |
assert($oa->strictCheckSyntax('(requesting)') === false); |
assert($oa->strictCheckSyntax('0', false, true) === true); |
assert($oa->strictCheckSyntax('1', false, true) === true); |
assert($oa->strictCheckSyntax('(requesting)', false, true) === false); |
/trunk/uuid_utils.inc.phps |
---|
2,8 → 2,8 |
/* |
* UUID utils for PHP |
* Copyright 2011 - 2022 Daniel Marschall, ViaThinkSoft |
* Version 2022-01-06 |
* Copyright 2011 - 2021 Daniel Marschall, ViaThinkSoft |
* Version 2021-05-21 |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* you may not use this file except in compliance with the License. |
162,7 → 162,7 |
if (function_exists('decode_mac')) { |
echo "\nIn case that this Node ID is a MAC address, here is the interpretation of that MAC address:\n"; |
echo decode_mac($nodeid); |
echo decode_mac($nodeid); /** @phpstan-ignore-line */ |
} |
break; |
220,7 → 220,7 |
if (function_exists('decode_mac')) { |
echo "\nIn case that this Node ID is a MAC address, here is the interpretation of that MAC address:\n"; |
echo decode_mac($nodeid); |
echo decode_mac($nodeid); /** @phpstan-ignore-line */ |
} |
break; |
293,7 → 293,7 |
function oid_to_uuid($oid) { |
if (!is_uuid_oid($oid)) return false; |
if (substr($oid,0,1) == '.') { |
if ($oid[0] == '.') { |
$oid = substr($oid, 1); |
} |
$ary = explode('.', $oid); |
313,7 → 313,7 |
} |
function is_uuid_oid($oid, $only_allow_root=false) { |
if (substr($oid,0,1) == '.') $oid = substr($oid, 1); // remove leading dot |
if ($oid[0] == '.') $oid = substr($oid, 1); // remove leading dot |
$ary = explode('.', $oid); |
485,8 → 485,7 |
} |
} else { |
// Linux |
$addresses = @glob('/sys/class/net/'.'*'.'/address'); |
foreach ($addresses as $x) { |
foreach (glob('/sys/class/net/'.'*'.'/address') as $x) { |
if (!strstr($x,'/lo/')) { |
$detected_mac = trim(file_get_contents($x)); |
return $detected_mac; |
/trunk |
---|
Property changes: |
Deleted: svn:ignore |
-.phpstan.tmp |
- |