Update Framework.php

修复二级目录图片主页
master
阿珏 7 years ago committed by GitHub
parent bd6356fef7
commit 7b1e9237dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -41,12 +41,6 @@ class Framework{
// 路由处理 // 路由处理
private function route(){ private function route(){
if(preg_match('#^/([a-zA-Z0-9.]{25,})#',$_SERVER['REQUEST_URI'],$pid) && isset($pid[1])){
$m = 'Home';
$c = 'Index';
$a = 'DetailsAction';
$_GET['pid'] = $pid[1];
}else{
$m = isset($_GET['m']) ? $_GET['m'] : 'Home';// 模块 $m = isset($_GET['m']) ? $_GET['m'] : 'Home';// 模块
$c = isset($_GET['c']) ? $_GET['c'] : 'Index';// 控制器 $c = isset($_GET['c']) ? $_GET['c'] : 'Index';// 控制器
$a = isset($_GET['a']) ? $_GET['a'] : 'IndexAction';// 方法 $a = isset($_GET['a']) ? $_GET['a'] : 'IndexAction';// 方法
@ -59,6 +53,12 @@ class Framework{
$path = trim(preg_replace('/'.trim(substr($str,0,strpos($str, '/index.php')),'/').'/','',$path),'/'); $path = trim(preg_replace('/'.trim(substr($str,0,strpos($str, '/index.php')),'/').'/','',$path),'/');
} }
} }
if(preg_match('#^/([a-zA-Z0-9.]{25,})#','/'.$path,$pid) && isset($pid[1])){
$m = 'Home';
$c = 'Index';
$a = 'DetailsAction';
$_GET['pid'] = $pid[1];
}else{
$path = preg_replace('/'.$suffix.'/', '', $path, 1); $path = preg_replace('/'.$suffix.'/', '', $path, 1);
if ($path != '') { if ($path != '') {
$path = preg_replace('/[?,=,&]/', '/', $path); $path = preg_replace('/[?,=,&]/', '/', $path);

Loading…
Cancel
Save