diff --git a/petitnote/functions.php b/petitnote/functions.php index 2d71b083..19cf0b0f 100644 --- a/petitnote/functions.php +++ b/petitnote/functions.php @@ -229,6 +229,7 @@ function set_darkmode(){ function branch_destination_of_location(){ $page=(int)filter_input(INPUT_POST,'postpage',FILTER_VALIDATE_INT); $resno=(int)filter_input(INPUT_POST,'resno',FILTER_VALIDATE_INT); + $resno= $resno ? $resno : (int)filter_input(INPUT_POST,'postresno',FILTER_VALIDATE_INT); $catalog=(bool)filter_input(INPUT_POST,'catalog',FILTER_VALIDATE_BOOLEAN); $search=(bool)filter_input(INPUT_POST,'search',FILTER_VALIDATE_BOOLEAN); $paintcom=(bool)filter_input(INPUT_POST,'paintcom',FILTER_VALIDATE_BOOLEAN); @@ -238,6 +239,9 @@ function branch_destination_of_location(){ return header('Location: ./?mode=paintcom'); } if($resno){ + if(!is_file(LOG_DIR.$resno.'.log')){ + return header('Location: ./'); + } $res_catalog = $res_catalog ? '&res_catalog=on' : ''; return header('Location: ./?resno='.h($resno).$res_catalog); } diff --git a/petitnote/index.php b/petitnote/index.php index 915b4fd1..d296505b 100644 --- a/petitnote/index.php +++ b/petitnote/index.php @@ -2064,15 +2064,8 @@ function del(){ closeFile($fp); unset($_SESSION['userdel']); - $resno=(string)filter_input(INPUT_POST,'postresno',FILTER_VALIDATE_INT); //多重送信防止 - if((bool)filter_input(INPUT_POST,'resmode',FILTER_VALIDATE_BOOLEAN)){ - if(!is_file(LOG_DIR.$resno.'.log')){ - return header('Location: ./'); - } - return header('Location: ./?resno='.$resno); - } - return header('Location: ./?page='.(int)filter_input(INPUT_POST,'postpage',FILTER_VALIDATE_INT)); + branch_destination_of_location(); } //シェアするserverの選択画面