0
1
Fork 0
hedera-web-mindshore/package/usr/share/php/vn/hedera/util.php

25 lines
448 B
PHP
Executable File

<?php
namespace Vn\Hedera;
function checkToken ($token)
{
return preg_match ('/^[\w\-]+$/', $token);
}
function nullIf ($map, $key)
{
return isset ($map[$key]) ? $map[$key] : NULL;
}
function checkFilePath ($file, $path)
{
$checkPath = stream_resolve_include_path ($path).'/';
$filePath = stream_resolve_include_path ($checkPath.$file);
$len = strlen ($checkPath);
return substr ($filePath, 0, strlen ($checkPath)) === $checkPath;
}
?>