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

25 lines
448 B
PHP
Raw Normal View History

<?php
namespace Vn\Hedera;
function checkToken ($token)
{
return preg_match ('/^[\w\-]+$/', $token);
}
2015-02-17 11:48:53 +00:00
function nullIf ($map, $key)
{
return isset ($map[$key]) ? $map[$key] : NULL;
}
2015-01-31 01:05:12 +00:00
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;
}
?>