From 007423e9e7b2295e827f62707091cf47fd234919 Mon Sep 17 00:00:00 2001 From: LyLme Date: Sat, 26 Mar 2022 11:13:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=85=A5=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apply/index.php | 61 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/apply/index.php b/apply/index.php index 25d8eea..12a64ac 100644 --- a/apply/index.php +++ b/apply/index.php @@ -1,21 +1,23 @@ query("SELECT * FROM `lylme_groups`"); + if(isset($_REQUEST['authcode'])){ session_start(); if(strtolower($_REQUEST['authcode'])== $_SESSION['authcode']){ if(isset($_POST['name'])&& isset($_POST['url'])&& isset($_POST['icon'])&& isset($_POST['group_id'])&& isset($_POST['mail'])!=NULL){ - $name=daddslashes($_POST['name']); - $url=daddslashes($_POST['url']); - $icon=daddslashes($_POST['icon']); - $group_id=daddslashes($_POST['group_id']); - $mail=daddslashes($_POST['mail']); - $sw = 1; - $date = date("Y-m-d H:i:s"); + $status = $conf["apply"]; if($status==2) { exit(''); } + $name=strip_tags(daddslashes($_POST['name'])); + $url=strip_tags(daddslashes($_POST['url'])); + $icon=daddslashes($_POST['icon']); + $group_id=daddslashes($_POST['group_id']); + $mail=strip_tags(daddslashes($_POST['mail'])); + $sw = 1; + $date = date("Y-m-d H:i:s"); if(empty($status)){ $status=0; } @@ -23,21 +25,22 @@ if(isset($_REQUEST['authcode'])){ if($sw == 1){ if(empty($name) || empty($url) || empty($icon) || empty($group_id) || empty($mail) ){ exit(''); - } else if(strpos($icon, 'http') !== 0 && strpos($icon, 'alert("提交失败,请按要求填写!");history.go(-1);'); + } else if(!preg_match('{^http[s]?://([\w-]+\.)+[\w]+(/[\w-./%&=]*)\.(jpg|png|ico)$}i', $icon) + || !preg_match('{^http[s]?://([\w-]+\.)+[\w-]+(/[\w-./?%&#=]*)?$}i', $url)) { + exit(''); } else{ $sql = "INSERT INTO `lylme_apply` (`apply_id`, `apply_name`, `apply_url`, `apply_group`, `apply_icon`, `apply_mail`, `apply_time`, `apply_status`) VALUES (NULL, '".$name."', '".$url."', '".$group_id."', '".$icon."', '".$mail."', '".$date."', '".$status."');"; if($DB->query($sql)){ switch ($status) { case 0: - echo ''; + echo ''; break; case 1: - echo ''; + echo ''; break; } } else{ - echo ''; + echo ''; } } } @@ -112,6 +115,9 @@ if(isset($_REQUEST['authcode'])){
+

网站已关闭申请收录

'); + }?>

申请收录

- +
- \ No newline at end of file + +