From 6367282bb5289278b5cbf1ba4359b6655b7fb9df Mon Sep 17 00:00:00 2001
From: Daichimarukana
Date: Wed, 29 Nov 2023 00:40:59 +0900
Subject: [PATCH] uwuzu version 1.2.27
---
addauthcode.php | 1 +
admin/addadmin.php | 1 +
admin/index.php | 1 +
admin/success.php | 1 +
api/bot-api.php | 2 +-
api/ltl-api.php | 2 +-
api/serverinfo-api.php | 9 +-
api/ueuse-api.php | 2 +-
api/userdata-api.php | 2 +-
authcodechk.php | 1 +
authlogin.php | 1 +
check.php | 1 +
css/home.css | 33 ++-
css/unsupported.css | 121 +++++++++
emoji/addemoji.php | 20 +-
emoji/index.php | 17 +-
errorpage/400.php | 6 +-
errorpage/401.php | 6 +-
errorpage/403.php | 6 +-
errorpage/404.php | 65 ++++-
errorpage/500.php | 6 +-
errorpage/503.php | 6 +-
errorpage/serverstop.php | 24 +-
home/ftl.php | 104 +++++++-
home/index.php | 106 +++++++-
img/sysimage/menuicon/notice.svg | 7 +
index.php | 17 +-
js/console_notice.js | 4 +-
js/unsupported.js | 112 +++++++++
login.php | 13 +-
new.php | 59 ++++-
nextpage/view.php | 76 +++++-
notice/addnotice.php | 20 +-
notification/index.php | 21 +-
others/index.php | 73 +++++-
others/token.php | 21 +-
passrecovery/badrecovery.php | 1 +
passrecovery/donerecovery.php | 1 +
passrecovery/index.php | 1 +
passrecovery/startrecovery.php | 1 +
require/botbox.php | 1 +
rule/privacypolicy.php | 2 +
rule/releasenotes.php | 2 +
rule/serverabout.php | 2 +
rule/terms.php | 2 +
rule/uwuzuabout.php | 2 +
search/index.php | 75 ++++--
server/serverstop.txt | 3 +-
server/uwuzuinfo.txt | 4 +-
server/uwuzurelease.txt | 42 ++++
settings/addauthcode.php | 19 +-
settings/index.php | 78 +++++-
settings/success.php | 21 +-
settings_admin/ad_admin.php | 17 +-
settings_admin/codeadmin.php | 17 +-
settings_admin/customize_admin.php | 17 +-
settings_admin/maintenance_admin.php | 339 ++++++++++++++++++++++++++
settings_admin/moderation_admin.php | 17 +-
settings_admin/overview_admin.php | 17 +-
settings_admin/role_admin.php | 17 +-
settings_admin/serveradmin.php | 30 +--
settings_admin/settings_left_menu.php | 1 +
settings_admin/useradmin.php | 17 +-
settings_admin/userinfo.php | 17 +-
success.php | 1 +
ueuse/index.php | 115 ++++++++-
unsupported.php | 103 ++++++++
user/index.php | 12 +-
user/report.php | 16 +-
user/success.php | 29 ++-
70 files changed, 1748 insertions(+), 258 deletions(-)
create mode 100644 css/unsupported.css
create mode 100644 img/sysimage/menuicon/notice.svg
create mode 100644 js/unsupported.js
create mode 100644 settings_admin/maintenance_admin.php
create mode 100644 unsupported.php
diff --git a/addauthcode.php b/addauthcode.php
index c7361c8..d82131e 100644
--- a/addauthcode.php
+++ b/addauthcode.php
@@ -194,6 +194,7 @@ $pdo = null;
+
diff --git a/admin/addadmin.php b/admin/addadmin.php
index 0d85c4d..877b2c3 100644
--- a/admin/addadmin.php
+++ b/admin/addadmin.php
@@ -436,6 +436,7 @@ $pdo = null;
+
diff --git a/admin/index.php b/admin/index.php
index a73c984..b5b74e3 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -85,6 +85,7 @@ $pdo = null;
+
diff --git a/admin/success.php b/admin/success.php
index a995c10..9970802 100644
--- a/admin/success.php
+++ b/admin/success.php
@@ -80,6 +80,7 @@ if(!(empty($_SESSION['backupcode']))){
+
diff --git a/api/bot-api.php b/api/bot-api.php
index ed518ac..367f7be 100644
--- a/api/bot-api.php
+++ b/api/bot-api.php
@@ -8,7 +8,7 @@ $banurldomainfile = "../server/banurldomain.txt";
$banurl_info = file_get_contents($banurldomainfile);
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
-header("Content-Type: application/json; charset=utf-8");
+header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;");
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
diff --git a/api/ltl-api.php b/api/ltl-api.php
index 4a1cb97..31c0d47 100644
--- a/api/ltl-api.php
+++ b/api/ltl-api.php
@@ -1,5 +1,5 @@
query($sql);
-
+
while ($row = $notice_array->fetch(PDO::FETCH_ASSOC)) {
$notices[] = $row;
@@ -111,6 +111,11 @@ for( $i=0;$i<$cnt;$i++ ){
"invitation_code" => $invitation_code,
+ "usage" => [
+ "users" => $count1,
+ "ueuse" => $count2,
+ ],
+
),
"software" => array(
diff --git a/api/ueuse-api.php b/api/ueuse-api.php
index afc9a6b..9eec954 100644
--- a/api/ueuse-api.php
+++ b/api/ueuse-api.php
@@ -1,5 +1,5 @@
+
diff --git a/authlogin.php b/authlogin.php
index 5161998..ca13378 100644
--- a/authlogin.php
+++ b/authlogin.php
@@ -251,6 +251,7 @@ $pdo = null;
+
diff --git a/check.php b/check.php
index bb3b913..da86e10 100644
--- a/check.php
+++ b/check.php
@@ -219,6 +219,7 @@ $pdo = null;
+
diff --git a/css/home.css b/css/home.css
index 483a44d..843d659 100644
--- a/css/home.css
+++ b/css/home.css
@@ -281,7 +281,7 @@ body{
margin-left: 12px;
margin-right: 12px;
margin-bottom: 12px;
- background-color: var(--background-color)FFF;
+ background-color: var(--background-color);
width: 240px;
height: 100%;
margin-left: 0px;
@@ -1286,6 +1286,18 @@ main h1{
height: 350px;
border: 1px solid var(--border-color);
}
+.ueuse .youtube_and_nicovideo_player{
+ margin-top: 12px;
+ width: 100%;
+ height: fit-content;
+}
+.ueuse .youtube_and_nicovideo_player iframe{
+ border: none;
+ width: 100%;
+ aspect-ratio: 16 / 9;
+ border-radius: 10px;
+ border: 1px solid var(--border-color);
+}
.ueuse .abi{
margin-left:auto;
@@ -3139,22 +3151,24 @@ label>input {
}
.emjtex .fx{
- display: flex;
+ display: block;
+ max-width: 100%;
}
.emjtex img{
margin-top: auto;
margin-bottom: auto;
- margin-left: 4px;
+ margin-left: 6px;
margin-right: 4px;
- height: 64px;
+ max-height: 64px;
+ max-width: 98%;
}
.emjtex h3{
overflow-wrap: break-word;
margin-top: auto;
margin-bottom: auto;
- margin-left: 12px;
+ margin-left: 6px;
font-size: 24px;
color:var(--text-color);
text-decoration: none;
@@ -3166,7 +3180,7 @@ label>input {
overflow-wrap: break-word;
margin-top: 12px;
margin-bottom: auto;
- margin-left: 12px;
+ margin-left: 6px;
font-size: 16px;
color:var(--text-color);
text-decoration: none;
@@ -5046,13 +5060,15 @@ summary {
top: 0;
left: 0;
- width: 90%;
+ width: 100%;
margin-left: 0px;
margin-right: 0px;
height: 44px;
padding-top: 0.0%;
padding-bottom: 0.2%;
- padding-left: 10%;
+ padding-left: 0;
+ margin-left: auto;
+ margin-right: auto;
}
.topbox .logo img{
@@ -5263,7 +5279,6 @@ summary {
}
-
.notification .flebox a{
margin-top: auto;
margin-bottom: auto;
diff --git a/css/unsupported.css b/css/unsupported.css
new file mode 100644
index 0000000..1bcf707
--- /dev/null
+++ b/css/unsupported.css
@@ -0,0 +1,121 @@
+
+@import url("color.css");
+body{
+ max-width: 640px;
+ height: auto;
+ margin:0px;
+ margin-top: 128px;
+ margin-left: auto;
+ margin-right: auto;
+ background-color:#f5f5f5;
+ display: block;
+}
+main{
+ max-width: 640px;
+ margin-left: auto;
+ margin-right: auto;
+}
+main .server_icon_zone{
+ margin:12px;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+}
+main .server_icon_zone img{
+ width: 64px;
+ height: 64px;
+ object-fit: cover;
+ border-radius: 12px;
+}
+h1{
+ margin-top: 0px;
+ margin-bottom: 0px;
+ margin-left: auto;
+ margin-right: auto;
+ text-align: center;
+ color:#252525;
+ font-size: 32px;
+ font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif;
+ font-weight: bold;
+}
+h3{
+ line-height: 28px;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ margin-left: 0px;
+ margin-right: auto;
+ text-align: left;
+ color:#252525;
+ font-size: 20px;
+ font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif;
+ font-weight: bold;
+}
+p{
+ line-height: 20px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ text-align: left;
+ color:#252525;
+ font-size: 16px;
+ font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif;
+ font-weight: normal;
+}
+.maintext{
+ margin-top: 16px;
+ margin-bottom: 16px;
+
+}
+.infobtn{
+ display: block;
+ width: 128px;
+ padding: 6px;
+ text-align: center;
+ margin-left: auto;
+ margin-right: auto;
+ display: block;
+ background-color:#FFC832;
+ color:#ffffff;
+ border-radius: 32px;
+ font-size: 20px;
+ font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif;
+ font-weight: normal;
+ text-decoration: none;
+}
+.center_text{
+ margin-top: 32px;
+ display: block;
+}
+.center_text p{
+ line-height: 20px;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ text-align: center;
+ color:#252525;
+ font-size: 16px;
+ font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif;
+ font-weight: normal;
+}
+.center_text .p2{
+ line-height: 20px;
+ margin-top: 6px;
+ margin-bottom: 6px;
+ text-align: center;
+ color:#777;
+ font-size: 16px;
+ font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif;
+ font-weight: normal;
+}
+hr{
+ height: 0;
+ margin-top: 12px;
+ margin-bottom: 12px;
+ padding: 0;
+ border: 0;
+ border-top: 1px solid #252525;
+}
+@media screen and (max-width:640px) {
+ body{
+ margin:24px;
+ margin-top: 32px;
+ }
+}
\ No newline at end of file
diff --git a/emoji/addemoji.php b/emoji/addemoji.php
index cf2b530..feb4a6b 100644
--- a/emoji/addemoji.php
+++ b/emoji/addemoji.php
@@ -27,9 +27,6 @@ session_name('uwuzu_s_id');
session_start();
session_regenerate_id(true);
-$userid = htmlentities($_SESSION['userid']);
-$username = htmlentities($_SESSION['username']);
-
try {
$option = array(
@@ -46,7 +43,7 @@ try {
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
- $passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
+ $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
@@ -55,11 +52,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
// セッションに値をセット
- $userid = htmlentities($_SESSION['userid']); // セッションに格納されている値をそのままセット
- $username = htmlentities($_SESSION['username']); // セッションに格納されている値をそのままセット
+ $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
+ $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
+ $myblocklist = htmlentities($res["blocklist"]);
+ $myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
@@ -92,7 +91,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
- $passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
+ $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
@@ -101,11 +100,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
// セッションに値をセット
- $userid = htmlentities($_COOKIE['userid']); // クッキーから取得した値をセット
- $username = htmlentities($_COOKIE['username']); // クッキーから取得した値をセット
+ $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
+ $username = htmlentities($res['username']); // クッキーから取得した値をセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
+ $myblocklist = htmlentities($res["blocklist"]);
+ $myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
@@ -312,6 +313,7 @@ $pdo = null;
+
diff --git a/emoji/index.php b/emoji/index.php
index 22841bf..cf96931 100644
--- a/emoji/index.php
+++ b/emoji/index.php
@@ -45,7 +45,7 @@ try {
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
- $passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
+ $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
@@ -54,11 +54,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
// セッションに値をセット
- $userid = htmlentities($_SESSION['userid']); // セッションに格納されている値をそのままセット
- $username = htmlentities($_SESSION['username']); // セッションに格納されている値をそのままセット
+ $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
+ $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
+ $myblocklist = htmlentities($res["blocklist"]);
+ $myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
@@ -91,7 +93,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
- $passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
+ $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
@@ -100,11 +102,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
// セッションに値をセット
- $userid = htmlentities($_COOKIE['userid']); // クッキーから取得した値をセット
- $username = htmlentities($_COOKIE['username']); // クッキーから取得した値をセット
+ $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
+ $username = htmlentities($res['username']); // クッキーから取得した値をセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
+ $myblocklist = htmlentities($res["blocklist"]);
+ $myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
@@ -177,6 +181,7 @@ $pdo = null;
+
diff --git a/errorpage/400.php b/errorpage/400.php
index b87b30c..5a2b076 100644
--- a/errorpage/400.php
+++ b/errorpage/400.php
@@ -20,8 +20,12 @@ $termsdata = file_get_contents($termsfile);
+
+
+
+
400 Bad Request -
@@ -29,7 +33,7 @@ $termsdata = file_get_contents($termsfile);
-

+
diff --git a/errorpage/401.php b/errorpage/401.php
index 9be45b4..e7a4935 100644
--- a/errorpage/401.php
+++ b/errorpage/401.php
@@ -20,8 +20,12 @@ $termsdata = file_get_contents($termsfile);
+
+
+
+
401 Unauthorized -
@@ -29,7 +33,7 @@ $termsdata = file_get_contents($termsfile);
-

+
diff --git a/errorpage/403.php b/errorpage/403.php
index 140dea0..e6d7b5e 100644
--- a/errorpage/403.php
+++ b/errorpage/403.php
@@ -20,8 +20,12 @@ $termsdata = file_get_contents($termsfile);
+
+
+
+
403 Forbidden -
@@ -29,7 +33,7 @@ $termsdata = file_get_contents($termsfile);
-

+
diff --git a/errorpage/404.php b/errorpage/404.php
index 92b2b7a..bc025c3 100644
--- a/errorpage/404.php
+++ b/errorpage/404.php
@@ -19,13 +19,16 @@ $termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?>
-
+
+
+
+
404 Not found -
@@ -33,7 +36,7 @@ $termsdata = file_get_contents($termsfile);
-

+
@@ -61,4 +64,60 @@ $termsdata = file_get_contents($termsfile);
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/errorpage/500.php b/errorpage/500.php
index 4d15dec..01ff9e2 100644
--- a/errorpage/500.php
+++ b/errorpage/500.php
@@ -20,8 +20,12 @@ $termsdata = file_get_contents($termsfile);
+
+
+
+
500 Internal Server Error -
@@ -29,7 +33,7 @@ $termsdata = file_get_contents($termsfile);
-

+
diff --git a/errorpage/503.php b/errorpage/503.php
index 86ca1b2..0bfd8aa 100644
--- a/errorpage/503.php
+++ b/errorpage/503.php
@@ -25,8 +25,12 @@ $termsdata = file_get_contents($termsfile);
+
+
+
+
503 Service Unavailable -
@@ -34,7 +38,7 @@ $termsdata = file_get_contents($termsfile);
-

+
diff --git a/errorpage/serverstop.php b/errorpage/serverstop.php
index 5839f48..7903eb5 100644
--- a/errorpage/serverstop.php
+++ b/errorpage/serverstop.php
@@ -4,6 +4,13 @@ $serverstopfile = "../server/serverstop.txt";
$servernamefile = "../server/servername.txt";
$domain = $_SERVER['HTTP_HOST'];
+
+if(!empty(file_get_contents($serverstopfile))){
+ $serverstop = htmlspecialchars(file_get_contents($serverstopfile), ENT_QUOTES, 'UTF-8');
+}else{
+ $serverstop = "現在原因不明の問題によりサーバーを停止しております。";
+}
+
?>
@@ -11,9 +18,13 @@ $domain = $_SERVER['HTTP_HOST'];
+
+
-サーバー停止中 -
+
+
+サーバー停止中 -
@@ -21,7 +32,7 @@ $domain = $_SERVER['HTTP_HOST'];
-

+
@@ -31,11 +42,14 @@ $domain = $_SERVER['HTTP_HOST'];
サーバー停止中
-
(/´・ヮ・`\)
現在サーバーが管理者によって停止されています...
停止の理由は以下の通りです。
+
現在サーバーが管理者によって停止されています...
停止の理由は以下の通りです。
-
-
+
';
+ }?>
diff --git a/home/ftl.php b/home/ftl.php
index 88736a2..54fb910 100644
--- a/home/ftl.php
+++ b/home/ftl.php
@@ -51,7 +51,7 @@ try {
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
- $passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
+ $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
@@ -60,11 +60,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
// セッションに値をセット
- $userid = htmlentities($_SESSION['userid']); // セッションに格納されている値をそのままセット
- $username = htmlentities($_SESSION['username']); // セッションに格納されている値をそのままセット
+ $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
+ $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
+ $myblocklist = htmlentities($res["blocklist"]);
+ $myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
@@ -97,7 +99,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
- $passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
+ $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
@@ -106,11 +108,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
// セッションに値をセット
- $userid = htmlentities($_COOKIE['userid']); // クッキーから取得した値をセット
- $username = htmlentities($_COOKIE['username']); // クッキーから取得した値をセット
+ $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
+ $username = htmlentities($res['username']); // クッキーから取得した値をセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
+ $myblocklist = htmlentities($res["blocklist"]);
+ $myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
@@ -188,6 +192,39 @@ function get_mentions_userid($postText) {
return $mentionedUsers;
}
+function rotate($image, $exif)
+{
+ $orientation = $exif['Orientation'] ?? 1;
+
+ switch ($orientation) {
+ case 1: //no rotate
+ break;
+ case 2: //FLIP_HORIZONTAL
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 3: //ROTATE 180
+ $image = imagerotate($image, 180, 0);
+ break;
+ case 4: //FLIP_VERTICAL
+ imageflip($image, IMG_FLIP_VERTICAL);
+ break;
+ case 5: //ROTATE 270 FLIP_HORIZONTAL
+ $image = imagerotate($image, 270, 0);
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 6: //ROTATE 90
+ $image = imagerotate($image, 270, 0);
+ break;
+ case 7: //ROTATE 90 FLIP_HORIZONTAL
+ $image = imagerotate($image, 90, 0);
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 8: //ROTATE 270
+ $image = imagerotate($image, 90, 0);
+ break;
+ }
+ return $image;
+}
if( !empty($_POST['btn_submit']) ) {
@@ -240,6 +277,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
+
+ // EXIF削除
+ if($extension == "jpg" || $extension == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath);
+ imagedestroy($gd_out);
+ }
if ($result) {
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用
@@ -280,6 +330,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2);
+
+ // EXIF削除
+ if($extension2 == "jpg" || $extension2 == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath2);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath2);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath2);
+ imagedestroy($gd_out);
+ }
if ($result2) {
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
@@ -320,6 +383,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3);
+
+ // EXIF削除
+ if($extension3 == "jpg" || $extension3 == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath3);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath3);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath3);
+ imagedestroy($gd_out);
+ }
if ($result3) {
$photo3 = $uploadedPath3; // 保存されたファイルのパスを使用
@@ -360,6 +436,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result4 = move_uploaded_file($uploadedFile4['tmp_name'], $uploadedPath4);
+
+ // EXIF削除
+ if($extension4 == "jpg" || $extension4 == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath4);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath4);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath4);
+ imagedestroy($gd_out);
+ }
if ($result4) {
$photo4 = $uploadedPath4; // 保存されたファイルのパスを使用
@@ -464,7 +553,7 @@ if( !empty($_POST['btn_submit']) ) {
$touserid = $mentionedUser;
$datetime = date("Y-m-d H:i:s");
$msg = "" . $ueuse . "";
- $title = "" . $username . "さんにメンションされました!";
+ $title = "" . $userid . "さんにメンションされました!";
$url = "/!" . $uniqid . "~" . $userid . "";
$userchk = 'none';
@@ -528,6 +617,7 @@ $pdo = null;
+
diff --git a/home/index.php b/home/index.php
index 4b982c2..bbbec03 100644
--- a/home/index.php
+++ b/home/index.php
@@ -1,5 +1,4 @@
prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
+ $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_SESSION['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
@@ -59,11 +58,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
exit;
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
// セッションに値をセット
- $userid = htmlentities($_SESSION['userid']); // セッションに格納されている値をそのままセット
- $username = htmlentities($_SESSION['username']); // セッションに格納されている値をそのままセット
+ $userid = htmlentities($res['userid']); // セッションに格納されている値をそのままセット
+ $username = htmlentities($res['username']); // セッションに格納されている値をそのままセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
+ $myblocklist = htmlentities($res["blocklist"]);
+ $myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
@@ -96,7 +97,7 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
- $passQuery = $pdo->prepare("SELECT username,userid,loginid,admin,role,sacinfo FROM account WHERE userid = :userid");
+ $passQuery = $pdo->prepare("SELECT username,userid,loginid,follow,admin,role,sacinfo,blocklist FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', htmlentities($_COOKIE['userid']));
$passQuery->execute();
$res = $passQuery->fetch();
@@ -105,11 +106,13 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
// セッションに値をセット
- $userid = htmlentities($_COOKIE['userid']); // クッキーから取得した値をセット
- $username = htmlentities($_COOKIE['username']); // クッキーから取得した値をセット
+ $userid = htmlentities($res['userid']); // クッキーから取得した値をセット
+ $username = htmlentities($res['username']); // クッキーから取得した値をセット
$loginid = htmlentities($res["loginid"]);
$role = htmlentities($res["role"]);
$sacinfo = htmlentities($res["sacinfo"]);
+ $myblocklist = htmlentities($res["blocklist"]);
+ $myfollowlist = htmlentities($res["follow"]);
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
@@ -187,6 +190,40 @@ function get_mentions_userid($postText) {
return $mentionedUsers;
}
+function rotate($image, $exif)
+{
+ $orientation = $exif['Orientation'] ?? 1;
+
+ switch ($orientation) {
+ case 1: //no rotate
+ break;
+ case 2: //FLIP_HORIZONTAL
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 3: //ROTATE 180
+ $image = imagerotate($image, 180, 0);
+ break;
+ case 4: //FLIP_VERTICAL
+ imageflip($image, IMG_FLIP_VERTICAL);
+ break;
+ case 5: //ROTATE 270 FLIP_HORIZONTAL
+ $image = imagerotate($image, 270, 0);
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 6: //ROTATE 90
+ $image = imagerotate($image, 270, 0);
+ break;
+ case 7: //ROTATE 90 FLIP_HORIZONTAL
+ $image = imagerotate($image, 90, 0);
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 8: //ROTATE 270
+ $image = imagerotate($image, 90, 0);
+ break;
+ }
+ return $image;
+}
+
if( !empty($_POST['btn_submit']) ) {
$ueuse = htmlentities($_POST['ueuse']);
@@ -239,6 +276,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
+
+ // EXIF削除
+ if($extension == "jpg" || $extension == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath);
+ imagedestroy($gd_out);
+ }
if ($result) {
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用
@@ -279,6 +329,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2);
+
+ // EXIF削除
+ if($extension2 == "jpg" || $extension2 == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath2);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath2);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath2);
+ imagedestroy($gd_out);
+ }
if ($result2) {
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
@@ -319,6 +382,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3);
+
+ // EXIF削除
+ if($extension3 == "jpg" || $extension3 == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath3);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath3);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath3);
+ imagedestroy($gd_out);
+ }
if ($result3) {
$photo3 = $uploadedPath3; // 保存されたファイルのパスを使用
@@ -359,6 +435,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result4 = move_uploaded_file($uploadedFile4['tmp_name'], $uploadedPath4);
+
+ // EXIF削除
+ if($extension4 == "jpg" || $extension4 == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath4);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath4);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath4);
+ imagedestroy($gd_out);
+ }
if ($result4) {
$photo4 = $uploadedPath4; // 保存されたファイルのパスを使用
@@ -463,7 +552,7 @@ if( !empty($_POST['btn_submit']) ) {
$touserid = $mentionedUser;
$datetime = date("Y-m-d H:i:s");
$msg = "" . $ueuse . "";
- $title = "" . $username . "さんにメンションされました!";
+ $title = "" . $userid . "さんにメンションされました!";
$url = "/!" . $uniqid . "~" . $userid . "";
$userchk = 'none';
@@ -527,6 +616,7 @@ $pdo = null;
+
diff --git a/img/sysimage/menuicon/notice.svg b/img/sysimage/menuicon/notice.svg
new file mode 100644
index 0000000..d6e2525
--- /dev/null
+++ b/img/sysimage/menuicon/notice.svg
@@ -0,0 +1,7 @@
+
diff --git a/index.php b/index.php
index 00186e3..4cd09ca 100644
--- a/index.php
+++ b/index.php
@@ -110,9 +110,18 @@ $count2 = $result2->num_rows;
?>
-
+
+
+
+
+
+
+
+
+
+
@@ -156,7 +165,7 @@ if ("serviceWorker" in navigator) {
- へようこそ!
+ へようこそ!
, ENT_QUOTES, 'UTF-8'); ?>)
@@ -166,7 +175,7 @@ if ("serviceWorker" in navigator) {
-
+
@@ -176,7 +185,7 @@ if ("serviceWorker" in navigator) {
echo $info.'
';
}?>
- お問い合わせ :
+ お問い合わせ :
このサーバーには招待コードがないと登録できません。
招待コードはお手元にありますか?
diff --git a/js/console_notice.js b/js/console_notice.js
index 68c5917..cced145 100644
--- a/js/console_notice.js
+++ b/js/console_notice.js
@@ -1,3 +1,4 @@
+/*-----Console Notice-----*/
console.log(
"%c警告!!!%c\nもし誰かにここに%cコピペ%cしろと言われたりCookieというものをコピーしろなどと言われているのであればその行為は%c今すぐやめて%cください。",
"color:white; background-color:#FF4848; padding:4px; border-radius:4px; font-weight: bold; font-size: 16pt",
@@ -26,5 +27,4 @@ console.log(
"color:#000;",
"",
"uwuzuサーバー運営者及びuwuzu開発者がCookie情報等を要求することはありません。",
-);
-
+);
\ No newline at end of file
diff --git a/js/unsupported.js b/js/unsupported.js
new file mode 100644
index 0000000..ff4b2d9
--- /dev/null
+++ b/js/unsupported.js
@@ -0,0 +1,112 @@
+/*-----Access Check-----*/
+
+const ua = window.navigator.userAgent;
+/*browser*/
+if(ua.indexOf('Edge') != -1 || ua.indexOf('Edg') != -1) {
+ user_agent_browser = 'Microsoft_Edge';
+} else if(ua.indexOf('Trident') != -1 || ua.indexOf('MSIE') != -1) {
+ user_agent_browser = 'Microsoft_Internet_Explorer';
+} else if(ua.indexOf('OPR') != -1 || ua.indexOf('Opera') != -1) {
+ user_agent_browser = 'Opera';
+} else if(ua.indexOf('Chrome') != -1) {
+ user_agent_browser = 'Google_Chrome';
+} else if(ua.indexOf('Firefox') != -1) {
+ user_agent_browser = 'FireFox';
+} else if(ua.indexOf('Safari') != -1) {
+ user_agent_browser = 'Safari';
+} else if(ua.indexOf('NintendoBrowser') != -1) {
+ user_agent_browser = 'NintendoBrowser';
+} else {
+ user_agent_browser = 'Other';
+}
+
+/*OS*/
+const ua2 = ua.toLowerCase();
+if(ua2.indexOf("windows nt") !== -1) {
+ user_agent_os = "Microsoft_Windows_NT";
+} else if(ua.indexOf("Android") !== -1) {
+ user_agent_os = "Android";
+} else if(ua.indexOf("iPhone") !== -1){
+ ua.match(/iPhone OS (\w+){1,4}/g);
+ var iosv=(RegExp.$1.replace(/_/g, '.')).slice(0,4);
+ if(iosv >= 6.0) {
+ user_agent_os = "iOS_6_Over";
+ } else {
+ user_agent_os = "iOS_6_Under";
+ }
+} else if (ua.match(/Linux/)) {
+ user_agent_os = "Linux";
+} else if(ua.indexOf("ipad") !== -1 || ua.indexOf("Mac OS X") !== -1 && typeof document.ontouchstart !== 'undefined') {
+ user_agent_os = "iPad";
+} else if(ua.indexOf("Mac OS X") !== -1) {
+ user_agent_os = "mac_OS";
+} else if (ua.match(/^.*\s([A-Za-z]+BSD)/)) {
+ user_agent_os = RegExp.$1;
+} else if (ua.match(/SunOS/)) {
+ user_agent_os = "Solaris";
+} else if (ua.match("Nintendo Wii")) {
+ user_agent_os = "Nintendo_Wii";
+} else if (ua.match("PlayStation 4")) {
+ user_agent_os = "SONY_PS4";
+} else if (ua.match("PlayStation 5")) {
+ user_agent_os = "SONY_PS5";
+} else if (ua.match("PlayStation Vita")) {
+ user_agent_os = "SONY_PSVita";
+} else if (ua.match("Nintendo Switch")) {
+ user_agent_os = "Nintendo_Switch";
+} else if (ua.match("Windows Phone")) {
+ user_agent_os = "Windows_Phone";
+} else {
+ user_agent_os = 'Other';
+}
+
+/*SSL*/
+if (location.protocol == 'http:') {
+ user_agent_ssl = "not_ssl";
+} else if (location.protocol == 'https:') {
+ user_agent_ssl = "ssl";
+} else {
+ user_agent_ssl = "Other";
+}
+
+/*Cookie*/
+if (navigator.cookieEnabled) {
+ user_agent_cookie = 'cookie_on';
+} else {
+ user_agent_cookie = 'cookie_off';
+}
+
+/*Main Access check*/
+if (user_agent_browser == 'Microsoft_Internet_Explorer' || user_agent_browser == 'NintendoBrowser') {
+ user_agent_access = 'bad';
+ errcode = 'UNSUPPORTED_BROWSER';
+} else if (user_agent_os == 'Nintendo_Wii' || user_agent_os == 'SONY_PSVita' || user_agent_os == 'Nintendo_Switch' || user_agent_os == 'Windows_Phone' || user_agent_os == 'iOS_6_Under') {
+ user_agent_access = 'bad';
+ errcode = 'UNSUPPORTED_OS';
+} else if (user_agent_cookie == 'cookie_off') {
+ user_agent_access = 'bad';
+ errcode = 'PLEASE_COOKIE_ON';
+} else if (user_agent_ssl == 'Other') {
+ user_agent_access = 'bad';
+ errcode = 'NONE_SSL';
+} else {
+ user_agent_access = 'ok';
+ errcode = 'NONE_ERROR';
+}
+
+/*
+console.log('browser : '+user_agent_browser);
+console.log('cookie : '+user_agent_cookie);
+console.log('os : '+user_agent_os);
+console.log('ssl : '+user_agent_ssl);
+console.log('access : '+user_agent_access);
+console.log('errorcode : '+errcode);
+*/
+
+if (user_agent_access == 'bad'){
+ setTimeout(link(), 0);
+ function link(){
+ location.href="../unsupported.php?errcode="+errcode+"&browser="+user_agent_browser+"&os="+user_agent_os+"&cookie="+user_agent_cookie+"&ssl="+user_agent_ssl+""
+ }
+}
+
diff --git a/login.php b/login.php
index 2ef80f2..178a36a 100644
--- a/login.php
+++ b/login.php
@@ -1,5 +1,5 @@
-
+
+
+
+
+
+
+
+
+
+
diff --git a/new.php b/new.php
index ae55578..51002b5 100644
--- a/new.php
+++ b/new.php
@@ -15,6 +15,7 @@ function createUniqId(){
}
require('db.php');
+$servericonfile = "server/servericon.txt";
$servernamefile = "server/servername.txt";
@@ -99,6 +100,40 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset
}
}
+function rotate($image, $exif)
+{
+ $orientation = $exif['Orientation'] ?? 1;
+
+ switch ($orientation) {
+ case 1: //no rotate
+ break;
+ case 2: //FLIP_HORIZONTAL
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 3: //ROTATE 180
+ $image = imagerotate($image, 180, 0);
+ break;
+ case 4: //FLIP_VERTICAL
+ imageflip($image, IMG_FLIP_VERTICAL);
+ break;
+ case 5: //ROTATE 270 FLIP_HORIZONTAL
+ $image = imagerotate($image, 270, 0);
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 6: //ROTATE 90
+ $image = imagerotate($image, 270, 0);
+ break;
+ case 7: //ROTATE 90 FLIP_HORIZONTAL
+ $image = imagerotate($image, 90, 0);
+ imageflip($image, IMG_FLIP_HORIZONTAL);
+ break;
+ case 8: //ROTATE 270
+ $image = imagerotate($image, 90, 0);
+ break;
+ }
+ return $image;
+}
+
if( !empty($_POST['btn_submit']) ) {
@@ -170,6 +205,19 @@ if( !empty($_POST['btn_submit']) ) {
// ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
+ // EXIF削除
+ if($extension == "jpg" || $extension == "jpeg"){
+ $gd = imagecreatefromjpeg($uploadedPath);
+ $w = imagesx($gd);
+ $h = imagesy($gd);
+ $gd_out = imagecreatetruecolor($w,$h);
+ imagecopyresampled($gd_out, $gd, 0,0,0,0, $w,$h,$w,$h);
+ $exif = exif_read_data($uploadedPath);
+ $gd_out = rotate($gd_out, $exif);
+ imagejpeg($gd_out, $uploadedPath);
+ imagedestroy($gd_out);
+ }
+
if ($result) {
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
} else {
@@ -467,9 +515,18 @@ $pdo = null;
?>
-
+
+
+
+
+
+
+
+
+
+
diff --git a/nextpage/view.php b/nextpage/view.php
index b5d5abb..fc0a34f 100644
--- a/nextpage/view.php
+++ b/nextpage/view.php
@@ -3,11 +3,6 @@
function processMarkdownAndWrapEmptyLines($markdownText){
$markdownText = preg_replace('/^\[\[buruburu (.+)\]\]/m', '$1
', $markdownText);//←ここ!!!!!!!!!!!!!!
- // コード(#code)をHTMLのdiv class="code"タグに変換
- $markdownText = preg_replace('/^#code (.+)/m', '', $markdownText);
-
- // 画像(#img)をHTMLのimgタグに変換
- $markdownText = preg_replace('/^#img (.+)/m', '
', $markdownText);
// タイトル(#、##、###)をHTMLのhタグに変換
$markdownText = preg_replace('/^# (.+)/m', '$1
', $markdownText);
@@ -15,7 +10,7 @@ function processMarkdownAndWrapEmptyLines($markdownText){
$markdownText = preg_replace('/^### (.+)/m', '$1
', $markdownText);
// 箇条書き(-)をHTMLのul/liタグに変換
- $markdownText = preg_replace('/^- (.+)/m', '', $markdownText);
+ $markdownText = preg_replace('/^- (.+)/m', '・ $1
', $markdownText);
// 空行の前に何もない行をHTMLのpタグに変換
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1$2
', $markdownText);
@@ -64,6 +59,9 @@ function replaceEmojisWithImages($postText) {
return $postTextWithHashtags;
}
function replaceURLsWithLinks($postText) {
+
+ $postText = str_replace(''', '\'', $postText);
+
// URLを正規表現を使って検出
$pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現
preg_match_all($pattern, $postText, $matches);
@@ -87,6 +85,68 @@ function replaceURLsWithLinks($postText) {
return $postText;
}
+function YouTube_and_nicovideo_Links($postText) {
+ // URLを正規表現を使って検出
+ $pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現
+ preg_match_all($pattern, $postText, $matches);
+
+ if(empty($url)){
+ $postText = "";
+ }
+
+ // 検出したURLごとに処理を行う
+ foreach ($matches[0] as $url) {
+ // ドメイン部分を抽出
+ $parsedUrl = parse_url($url);
+ if($parsedUrl['host'] == "youtube.com" || $parsedUrl['host'] == "youtu.be" || $parsedUrl['host'] == "www.youtube.com"){
+
+ if (isset($parsedUrl['query'])) {
+ if(false !== strpos($parsedUrl['query'], 'v=')) {
+ $video_id = str_replace('v=', '', htmlentities($parsedUrl['query']));
+ $iframe = true;
+ }else{
+ $video_id = str_replace('/', '', htmlentities($parsedUrl['path']));
+ $iframe = true;
+ }
+ }elseif(isset($parsedUrl['path'])){
+ $video_id = str_replace('/', '', htmlentities($parsedUrl['path']));
+ $iframe = true;
+ }else{
+ $video_id = "";
+ $iframe = false;
+ }
+ // 不要な文字を削除してaタグを生成
+ if($iframe == true){
+ $link = '';
+ }else{
+ $link = "";
+ }
+ // URLをドメインのみを表示するaタグで置き換え
+ $postText = $link;
+ }elseif($parsedUrl['host'] == "nicovideo.jp" || $parsedUrl['host'] == "www.nicovideo.jp"){
+
+ if(isset($parsedUrl['path'])){
+ $video_id = str_replace('/watch/', '', htmlentities($parsedUrl['path']));
+ $iframe = true;
+ }else{
+ $video_id = "";
+ $iframe = false;
+ }
+ // 不要な文字を削除してaタグを生成
+ if($iframe == true){
+ $link = '