return true; }elseif( isset($mat['password']) ) { // {password} $newurl = decrypt($mat['password']);//解密得到 cid_id preg_match("/^(\d+)\_(\d+)$/i", $newurl, $mat); if( isset($mat[2]) ) { $_GET['cid'] = $mat[1]; $_GET['id'] = $mat[2]; return true; } }elseif( isset($mat['alias']) ) { // {alias} preg_match("/^(\d+)\_(\d+)$/i", $mat['alias'], $mat2); //没有设置别名,将用 cid_id 组合 if( isset($mat2[2]) ) { $_GET['cid'] = $mat2[1]; $_GET['id'] = $mat2[2]; return true; } $row = $this->only_alias->get($mat['alias']); if(!empty($row)) { $_GET['cid'] = $row['cid']; $_GET['id'] = $row['id']; return true; } }elseif( isset($mat['hashids']) ) { // {hashids} $newurl = hashids_decrypt($mat['hashids']);//解密得到 cid id 数组 if(is_array($newurl) && isset($newurl[1])){ $_GET['cid'] = $newurl[0]; $_GET['id'] = $newurl[1]; return true; } } // 比如article/id.html,只能一个文章模型(多模型的不行,没法区分id属于那个模型的),因此丢到最后 if ( isset($mat['id']) && $this->integer_check($mat['id']) ){ $u_arr = explode('/', $uri); if( substr($cfg['link_show'], 0, strlen($u_arr[0])) == $u_arr[0] ){ $_GET['mid'] = 2; $_GET['id'] = $mat['id']; return true; } } } break; case 8: //HashIDS $newurl = hashids_decrypt($newurl);//解密得到 cid id 数组 if(is_array($newurl) && isset($newurl[1])){ $_GET['cid'] = $newurl[0]; $_GET['id'] = $newurl[1]; return true; } break; } unset($_GET['control']); unset($_GET['action']); return false; } //标签URL解析 protected function tag_url($cfg = array(), $uri = ''){ $len = strlen($cfg['link_tag_pre']); if(substr($uri, 0, $len) == $cfg['link_tag_pre']) { $len2 = strlen($cfg['link_tag_end']); if(substr($uri, -$len2) == $cfg['link_tag_end']) { $_GET['control'] = 'tag'; $_GET['action'] = 'index'; $newurl = substr($uri, $len, -$len2); $u_arr = explode('/', $newurl); $u_arr_count = count($u_arr); if($u_arr_count > 2){ core::error404(); } //分页 if( isset($u_arr[1]) ){ $page = $this->page_check($u_arr[1]); if($page){ $_GET['page'] = $page; }else{ core::error404(); } } switch ($cfg['link_tag_type']){ case 0: preg_match('/^(\d+)\_(.+)$/i', $u_arr[0], $mat); if( isset($mat[2]) ) { if( !$this->mid_check($mat[1], $cfg) ){core::error404();} $_GET['mid'] = $mat[1]; $_GET['name'] = $mat[2]; return true; }else{ $_GET['mid'] = 2; $_GET['name'] = $u_arr[0]; return true; } break; case 1: preg_match("/^(\d+)\_(\d+)$/i", $u_arr[0], $mat); if( isset($mat[2]) ) { if( !$this->mid_check($mat[1], $cfg) ){core::error404();} $_GET['mid'] = $mat[1]; $_GET['tagid'] = $mat[2]; return true; }elseif( $this->integer_check($u_arr[0]) ){ $_GET['mid'] = 2; $_GET['tagid'] = $u_arr[0]; return true; } break; case 2: $newurl = decrypt($u_arr[0]);//解密得到 mid_tagid preg_match("/^(\d+)\_(\d+)$/i", $newurl, $mat); if( isset($mat[2]) ){ if( !$this->mid_check($mat[1], $cfg) ){core::error404();} $_GET['mid'] = (int)$mat[1]; $_GET['tagid'] = (int)$mat[2]; return true; } break; case 3: $newurl = hashids_decrypt($u_arr[0]);//解密得到 mid tagid 数组 if(is_array($newurl) && isset($newurl[1])){ $_GET['mid'] = (int)$newurl[0]; $_GET['tagid'] = (int)$newurl[1]; return true; } break; } }else{ //尝试301跳转到带后缀的链接试试看~ http_location($cfg['weburl'].$uri.$cfg['link_tag_end'], '301'); } } unset($_GET['control']); unset($_GET['action']); return false; } //搜索URL解析 protected function search_url($cfg = array(), $uri = ''){ if(substr($uri, 0, 7) == 'search/') { if(substr($uri, -1) != '/'){$uri .= '/';} $newurl = substr($uri, 7, -1); $uarr = explode('/', $newurl); //模型ID if(isset($uarr[0]) && substr($uarr[0], 0 ,4) == 'mid_'){ $mid = substr($uarr[0], 4); if($this->mid_check($mid, $cfg)){ $_GET['mid'] = $mid; array_shift($uarr); }else{ core::error404(); } }else{ $_GET['mid'] = 2; } //排除多余的参数 if(count($uarr) > 2){core::error404();} //关键词 $_GET['keyword'] = $uarr[0]; //分页 if( isset($uarr[1]) ){ $page = $this->page_check($uarr[1]); if($page){ $_GET['page'] = $page; }else{ core::error404(); } } $_GET['control'] = 'search'; $_GET['action'] = 'index'; return true; } //搜索页面链接解析 $url_suffix = isset($_ENV['_config']['url_suffix']) ? $_ENV['_config']['url_suffix'] : '.html'; $url_suffix_len = strlen($url_suffix); if(substr($uri, -$url_suffix_len) == $url_suffix && substr($uri, 0, -$url_suffix_len) == 'so') { $_GET[ Lecms 3.0.3 lang[error]

lang[error_info]

lang[error_line]

lang[basic_trace]

lang[program_flow]

SQL

$_GET

$_POST

$_COOKIE

lang[include_file]

lang[other_trace]