Files
Pichome/core/class/dzz/modroute.php

30 lines
960 B
PHP
Raw Permalink Normal View History

2022-05-02 22:31:35 +08:00
<?php
namespace core\dzz;
class Modroute{
public function run(&$params){
global $_config,$action,$do;
$return = false;
$action = !empty($params[$_config['action_name']]) ? $params[$_config['action_name']]:$_config['default_action'];
$do = !empty($params[$_config['do_name']]) ? $params[$_config['do_name']]:'';
if(!empty($action)){
if(!preg_match("/^\w+$/i",$action)) showmessage('undefined_action');
if(!preg_match("/^\w+$/i",$do) && $do !== '') showmessage('undefined_action');
if(@!file_exists($file = DZZ_ROOT.CURSCRIPT.BS.CURMODULE.BS.OP_NAME.BS.$action.EXT) ){
if(@!file_exists($file = DZZ_ROOT.CURSCRIPT.BS.CURMODULE.BS.OP_NAME.BS.$action.BS.$do.EXT)){
2024-01-31 01:00:33 +08:00
header('Location:/404.html');exit();
2022-05-02 22:31:35 +08:00
}
}
$params['route_file']=$file;
return $file;
}
}
2021-09-17 10:56:51 +08:00
}