mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-19 18:32:52 +09:00
Add list of reserved words #763
This commit is contained in:
parent
fae2a05b6f
commit
97047d1279
6 changed files with 83 additions and 7 deletions
|
|
@ -19,20 +19,31 @@ class moduleModel extends module
|
|||
*/
|
||||
function isIDExists($id, $site_srl = 0)
|
||||
{
|
||||
if(!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i',$id)) return true;
|
||||
// directory and rss/atom/api reserved checking, etc.
|
||||
$dirs = FileHandler::readDir(_XE_PATH_);
|
||||
if (!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i', $id))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (Context::isReservedWord(strtolower($id)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
$dirs = array_map('strtolower', FileHandler::readDir(_XE_PATH_));
|
||||
$dirs[] = 'rss';
|
||||
$dirs[] = 'atom';
|
||||
$dirs[] = 'api';
|
||||
$dirs[] = 'admin';
|
||||
if(in_array($id, $dirs)) return true;
|
||||
if (in_array(strtolower($id), $dirs))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// mid test
|
||||
$args = new stdClass();
|
||||
$args->mid = $id;
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('module.isExistsModuleName', $args);
|
||||
if($output->data->count) return true;
|
||||
|
||||
// vid test (check mid != vid if site_srl=0, which means it is not a virtual site)
|
||||
if(!$site_srl)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue