forked from verdnatura/hedera-web
25 lines
448 B
PHP
Executable File
25 lines
448 B
PHP
Executable File
<?php
|
|
|
|
namespace Vn\Hedera;
|
|
|
|
function checkToken ($token)
|
|
{
|
|
return preg_match ('/^[\w\-]+$/', $token);
|
|
}
|
|
|
|
function ifNull ($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;
|
|
}
|
|
|
|
?>
|