Merge pull request #182 from yo3cat/master

XLX Alphanumeric names for reflector ...
This commit is contained in:
LX1IQ 2021-01-18 11:50:30 +01:00 committed by GitHub
commit bed3cf164b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View File

@ -41,12 +41,19 @@ class xReflector {
$handle = fopen($this->XMLFile, 'r');
$this->XMLContent = fread($handle, filesize($this->XMLFile));
fclose($handle);
# XLX alphanumeric naming...
$this->ServiceName = substr($this->XMLContent, strpos($this->XMLContent, "<XLX")+4, 3);
if (!is_numeric($this->ServiceName)) {
if (preg_match('/[^a-zA-Z0-9]/', $this->ServiceName) == 1) {
$this->ServiceName = null;
return false;
}
# $this->ServiceName = substr($this->XMLContent, strpos($this->XMLContent, "<XLX")+4, 3);
# if (!is_numeric($this->ServiceName)) {
# $this->ServiceName = null;
# return false;
# }
$this->ReflectorName = "XLX".$this->ServiceName;

View File

@ -41,13 +41,20 @@ class xReflector {
$handle = fopen($this->XMLFile, 'r');
$this->XMLContent = fread($handle, filesize($this->XMLFile));
fclose($handle);
# XLX alphanumeric naming...
$this->ServiceName = substr($this->XMLContent, strpos($this->XMLContent, "<XLX")+4, 3);
if (!is_numeric($this->ServiceName)) {
if (preg_match('/[^a-zA-Z0-9]/', $this->ServiceName) == 1) {
$this->ServiceName = null;
return false;
}
# $this->ServiceName = substr($this->XMLContent, strpos($this->XMLContent, "<XLX")+4, 3);
# if (!is_numeric($this->ServiceName)) {
# $this->ServiceName = null;
# return false;
# }
#
$this->ReflectorName = "XLX".$this->ServiceName;
$LinkedPeersName = "XLX".$this->ServiceName." linked peers";