mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu v1.6.12 Hapuego
This commit is contained in:
+19
-20
@@ -11,6 +11,18 @@ require('../db.php');
|
|||||||
require("../function/function.php");
|
require("../function/function.php");
|
||||||
blockedIP($_SERVER['REMOTE_ADDR']);
|
blockedIP($_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
|
$pdo = null;
|
||||||
|
try {
|
||||||
|
$option = array(
|
||||||
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
|
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||||
|
);
|
||||||
|
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
// 接続エラーのときエラー内容を取得する
|
||||||
|
$error_message[] = $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) && safetext(isset($_COOKIE['loginkey']))) {
|
if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) && safetext(isset($_COOKIE['loginkey']))) {
|
||||||
$userid = safetext($_POST['userid']);
|
$userid = safetext($_POST['userid']);
|
||||||
|
|
||||||
@@ -23,32 +35,17 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && s
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
$abidate = date("Y-m-d H:i:s");
|
$abidate = date("Y-m-d H:i:s");
|
||||||
|
|
||||||
// データベース接続の設定
|
$query = $pdo->prepare('SELECT * FROM ueuse WHERE uniqid = :uniqid limit 1');
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
));
|
|
||||||
|
|
||||||
$query = $dbh->prepare('SELECT * FROM ueuse WHERE uniqid = :uniqid limit 1');
|
|
||||||
|
|
||||||
$query->execute(array(':uniqid' => $postUniqid));
|
$query->execute(array(':uniqid' => $postUniqid));
|
||||||
|
|
||||||
$result = $query->fetch();
|
$result = $query->fetch();
|
||||||
|
|
||||||
if($result["account"] === $userid){
|
if($result["account"] === $userid){
|
||||||
// データベース接続の設定
|
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
));
|
|
||||||
|
|
||||||
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
|
||||||
|
|
||||||
$query->execute(array(':userid' => $userid));
|
$query->execute(array(':userid' => $userid));
|
||||||
|
|
||||||
@@ -81,8 +78,6 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && s
|
|||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
|
|
||||||
|
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
|
|
||||||
$stmt = $pdo->prepare("UPDATE ueuse SET abi = :abi, abidate = :abidate WHERE uniqid = :uniqid AND account = :userid");
|
$stmt = $pdo->prepare("UPDATE ueuse SET abi = :abi, abidate = :abidate WHERE uniqid = :uniqid AND account = :userid");
|
||||||
@@ -131,5 +126,9 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['abitext'])) && s
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
+9
-27
@@ -142,15 +142,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$iconName = $uploadedPath;
|
$iconName = $uploadedPath;
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$error_message[] = 'アップロード失敗!(1)エラーコード: ERROR';
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$uploadedFile['error'].'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -162,6 +154,8 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$uploadedFile = $_FILES['image'];
|
$uploadedFile = $_FILES['image'];
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../usericons/');
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(!(empty($uploadedFile['tmp_name']))){
|
if(!(empty($uploadedFile['tmp_name']))){
|
||||||
if(check_mime($uploadedFile['tmp_name'])){
|
if(check_mime($uploadedFile['tmp_name'])){
|
||||||
$extension = convert_mime(check_mime($uploadedFile['tmp_name']));
|
$extension = convert_mime(check_mime($uploadedFile['tmp_name']));
|
||||||
@@ -182,15 +176,8 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../usericons/') ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -204,6 +191,9 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------[header image]-------------------------------
|
//----------------[header image]-------------------------------
|
||||||
@@ -218,15 +208,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$headName = $uploadedPath;
|
$headName = $uploadedPath;
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$error_message[] = 'アップロード失敗!(1)エラーコード: ERROR';
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$uploadedFile['error'].'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
|
|||||||
+42
-80
@@ -111,18 +111,30 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||||||
|
|
||||||
|
|
||||||
if (!(empty($post_json["icon"]))) {
|
if (!(empty($post_json["icon"]))) {
|
||||||
$imageData = base64_decode($post_json["icon"], true);
|
$iconBase64 = $post_json["icon"];
|
||||||
|
|
||||||
|
if (strpos($iconBase64, ',') !== false) {
|
||||||
|
$iconBase64 = explode(',', $iconBase64)[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$imageData = base64_decode($iconBase64, true);
|
||||||
|
|
||||||
|
if ($imageData === false) {
|
||||||
|
$error_message[] = 'Base64のデコードに失敗しました!(base64_decode_failed)';
|
||||||
|
} else {
|
||||||
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_' . createUniqId());
|
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_' . createUniqId());
|
||||||
file_put_contents($tmpFilePath, $imageData);
|
file_put_contents($tmpFilePath, $imageData);
|
||||||
|
|
||||||
|
clearstatcache(true, $tmpFilePath);
|
||||||
|
|
||||||
$IconFiles = [
|
$IconFiles = [
|
||||||
'name' => 'upload.png',
|
'name' => 'upload.png',
|
||||||
'type' => check_mime($tmpFilePath),
|
'type' => check_mime($tmpFilePath),
|
||||||
'tmp_name' => $tmpFilePath,
|
'tmp_name' => $tmpFilePath,
|
||||||
'error' => UPLOAD_ERR_OK,
|
'error' => UPLOAD_ERR_OK,
|
||||||
'size' => strlen($imageData),
|
'size' => filesize($tmpFilePath),
|
||||||
];
|
];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$IconFiles = array();
|
$IconFiles = array();
|
||||||
}
|
}
|
||||||
@@ -131,6 +143,8 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||||||
if (isset($IconFiles)) {
|
if (isset($IconFiles)) {
|
||||||
if (!(empty($IconFiles['name']))) {
|
if (!(empty($IconFiles['name']))) {
|
||||||
$uploadedFile = $IconFiles;
|
$uploadedFile = $IconFiles;
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../../../usericons/');
|
||||||
|
if($beforeUploadError === null){
|
||||||
if (check_mime($uploadedFile['tmp_name'])) {
|
if (check_mime($uploadedFile['tmp_name'])) {
|
||||||
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
|
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
|
||||||
delete_exif($extension, $uploadedFile['tmp_name']);
|
delete_exif($extension, $uploadedFile['tmp_name']);
|
||||||
@@ -161,43 +175,8 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||||
$currentIconPath = getUserData($pdo, $userid)["iconname"];
|
$currentIconPath = getUserData($pdo, $userid)["iconname"];
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../../../usericons/') ?? "ERROR";
|
||||||
$errcode = "ERROR";
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
|
|
||||||
switch ($errnum) {
|
|
||||||
case 1:
|
|
||||||
$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$errcode = "FILE_SUKOSHIDAKE_UPLOAD";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$errcode = "FILE_UPLOAD_DEKINAKATTA";
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
$errcode = "TMP_FOLDER_NAI";
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
$errcode = "FILE_KAKIKOMI_SIPPAI";
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
$errcode = "PHPINFO()_KAKUNIN";
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
// 成功だったのに move_uploaded_file() が失敗した
|
|
||||||
if (!is_uploaded_file($uploadedFile['tmp_name'])) {
|
|
||||||
$errcode = "TMP_FILE_NAI";
|
|
||||||
} elseif (!is_writable(__DIR__ . '/../../../usericons/')) {
|
|
||||||
$errcode = "SAVE_FOLDER_KAKIKOMI_KENNAI";
|
|
||||||
} else {
|
|
||||||
$errcode = "MOVE_UPLOAD_FILE_SIPPAI";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' . $errcode . '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($s3result)) {
|
if (isset($s3result)) {
|
||||||
@@ -211,34 +190,49 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||||||
} else {
|
} else {
|
||||||
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(empty($iconName))) {
|
if (!(empty($iconName))) {
|
||||||
$add_sql[] = "iconname = :iconname";
|
$add_sql[] = "iconname = :iconname";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!(empty($post_json["header"]))) {
|
if (!(empty($post_json["header"]))) {
|
||||||
$imageData = base64_decode($post_json["header"], true);
|
$headerBase64 = $post_json["header"];
|
||||||
|
|
||||||
|
if (strpos($headerBase64, ',') !== false) {
|
||||||
|
$headerBase64 = explode(',', $headerBase64)[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$imageData = base64_decode($headerBase64, true);
|
||||||
|
|
||||||
|
if ($imageData === false) {
|
||||||
|
$error_message[] = 'Base64のデコードに失敗しました!(base64_decode_failed)';
|
||||||
|
} else {
|
||||||
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_' . createUniqId());
|
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_' . createUniqId());
|
||||||
file_put_contents($tmpFilePath, $imageData);
|
file_put_contents($tmpFilePath, $imageData);
|
||||||
|
|
||||||
|
clearstatcache(true, $tmpFilePath);
|
||||||
|
|
||||||
$HeadFiles = [
|
$HeadFiles = [
|
||||||
'name' => 'upload.png',
|
'name' => 'upload.png',
|
||||||
'type' => check_mime($tmpFilePath),
|
'type' => check_mime($tmpFilePath),
|
||||||
'tmp_name' => $tmpFilePath,
|
'tmp_name' => $tmpFilePath,
|
||||||
'error' => UPLOAD_ERR_OK,
|
'error' => UPLOAD_ERR_OK,
|
||||||
'size' => strlen($imageData),
|
'size' => filesize($tmpFilePath),
|
||||||
];
|
];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$HeadFiles = array();
|
$HeadFiles = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isset($HeadFiles)) {
|
if (isset($HeadFiles)) {
|
||||||
if (!(empty($HeadFiles['name']))) {
|
if (!(empty($HeadFiles['name']))) {
|
||||||
$uploadedFile = $HeadFiles;
|
$uploadedFile = $HeadFiles;
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../../../userheads/');
|
||||||
|
if($beforeUploadError === null){
|
||||||
if (check_mime($uploadedFile['tmp_name'])) {
|
if (check_mime($uploadedFile['tmp_name'])) {
|
||||||
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
|
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
|
||||||
delete_exif($extension, $uploadedFile['tmp_name']);
|
delete_exif($extension, $uploadedFile['tmp_name']);
|
||||||
@@ -269,43 +263,8 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||||||
$headName = $uploadedPath; // 保存されたファイルのパスを使用
|
$headName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||||
$currentHeadPath = getUserData($pdo, $userid)["headname"];
|
$currentHeadPath = getUserData($pdo, $userid)["headname"];
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../../../userheads/') ?? "ERROR";
|
||||||
$errcode = "ERROR";
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
|
|
||||||
switch ($errnum) {
|
|
||||||
case 1:
|
|
||||||
$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$errcode = "FILE_SUKOSHIDAKE_UPLOAD";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$errcode = "FILE_UPLOAD_DEKINAKATTA";
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
$errcode = "TMP_FOLDER_NAI";
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
$errcode = "FILE_KAKIKOMI_SIPPAI";
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
$errcode = "PHPINFO()_KAKUNIN";
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
// 成功だったのに move_uploaded_file() が失敗した
|
|
||||||
if (!is_uploaded_file($uploadedFile['tmp_name'])) {
|
|
||||||
$errcode = "TMP_FILE_NAI";
|
|
||||||
} elseif (!is_writable(__DIR__ . '/../../../usericons/')) {
|
|
||||||
$errcode = "SAVE_FOLDER_KAKIKOMI_KENNAI";
|
|
||||||
} else {
|
|
||||||
$errcode = "MOVE_UPLOAD_FILE_SIPPAI";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' . $errcode . '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($s3result)) {
|
if (isset($s3result)) {
|
||||||
@@ -319,6 +278,9 @@ if (isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||||||
} else {
|
} else {
|
||||||
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+70
-12
@@ -117,69 +117,117 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!(empty($post_json["image1"]))){
|
if(!(empty($post_json["image1"]))){
|
||||||
$imageData = base64_decode($post_json["image1"],true);
|
$imageBase64 = $post_json["image1"];
|
||||||
|
|
||||||
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_'.createUniqId());
|
if (strpos($imageBase64, ',') !== false) {
|
||||||
|
$imageBase64 = explode(',', $imageBase64)[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$imageData = base64_decode($imageBase64, true);
|
||||||
|
|
||||||
|
if ($imageData === false) {
|
||||||
|
$error_message[] = 'Base64のデコードに失敗しました!(base64_decode_failed)';
|
||||||
|
} else {
|
||||||
|
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_' . createUniqId());
|
||||||
file_put_contents($tmpFilePath, $imageData);
|
file_put_contents($tmpFilePath, $imageData);
|
||||||
|
|
||||||
|
clearstatcache(true, $tmpFilePath);
|
||||||
|
|
||||||
$Img1Files = [
|
$Img1Files = [
|
||||||
'name' => 'upload.png',
|
'name' => 'upload.png',
|
||||||
'type' => check_mime($tmpFilePath),
|
'type' => check_mime($tmpFilePath),
|
||||||
'tmp_name' => $tmpFilePath,
|
'tmp_name' => $tmpFilePath,
|
||||||
'error' => UPLOAD_ERR_OK,
|
'error' => UPLOAD_ERR_OK,
|
||||||
'size' => strlen($imageData),
|
'size' => filesize($tmpFilePath),
|
||||||
];
|
];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$Img1Files = array();
|
$Img1Files = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(empty($post_json["image2"]))){
|
if(!(empty($post_json["image2"]))){
|
||||||
$imageData = base64_decode($post_json["image2"],true);
|
$imageBase64 = $post_json["image2"];
|
||||||
|
|
||||||
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_'.createUniqId());
|
if (strpos($imageBase64, ',') !== false) {
|
||||||
|
$imageBase64 = explode(',', $imageBase64)[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$imageData = base64_decode($imageBase64, true);
|
||||||
|
|
||||||
|
if ($imageData === false) {
|
||||||
|
$error_message[] = 'Base64のデコードに失敗しました!(base64_decode_failed)';
|
||||||
|
} else {
|
||||||
|
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_' . createUniqId());
|
||||||
file_put_contents($tmpFilePath, $imageData);
|
file_put_contents($tmpFilePath, $imageData);
|
||||||
|
|
||||||
|
clearstatcache(true, $tmpFilePath);
|
||||||
|
|
||||||
$Img2Files = [
|
$Img2Files = [
|
||||||
'name' => 'upload.png',
|
'name' => 'upload.png',
|
||||||
'type' => check_mime($tmpFilePath),
|
'type' => check_mime($tmpFilePath),
|
||||||
'tmp_name' => $tmpFilePath,
|
'tmp_name' => $tmpFilePath,
|
||||||
'error' => UPLOAD_ERR_OK,
|
'error' => UPLOAD_ERR_OK,
|
||||||
'size' => strlen($imageData),
|
'size' => filesize($tmpFilePath),
|
||||||
];
|
];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$Img2Files = array();
|
$Img2Files = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(empty($post_json["image3"]))){
|
if(!(empty($post_json["image3"]))){
|
||||||
$imageData = base64_decode($post_json["image3"],true);
|
$imageBase64 = $post_json["image3"];
|
||||||
|
|
||||||
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_'.createUniqId());
|
if (strpos($imageBase64, ',') !== false) {
|
||||||
|
$imageBase64 = explode(',', $imageBase64)[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$imageData = base64_decode($imageBase64, true);
|
||||||
|
|
||||||
|
if ($imageData === false) {
|
||||||
|
$error_message[] = 'Base64のデコードに失敗しました!(base64_decode_failed)';
|
||||||
|
} else {
|
||||||
|
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_' . createUniqId());
|
||||||
file_put_contents($tmpFilePath, $imageData);
|
file_put_contents($tmpFilePath, $imageData);
|
||||||
|
|
||||||
|
clearstatcache(true, $tmpFilePath);
|
||||||
|
|
||||||
$Img3Files = [
|
$Img3Files = [
|
||||||
'name' => 'upload.png',
|
'name' => 'upload.png',
|
||||||
'type' => check_mime($tmpFilePath),
|
'type' => check_mime($tmpFilePath),
|
||||||
'tmp_name' => $tmpFilePath,
|
'tmp_name' => $tmpFilePath,
|
||||||
'error' => UPLOAD_ERR_OK,
|
'error' => UPLOAD_ERR_OK,
|
||||||
'size' => strlen($imageData),
|
'size' => filesize($tmpFilePath),
|
||||||
];
|
];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$Img3Files = array();
|
$Img3Files = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(empty($post_json["image4"]))){
|
if(!(empty($post_json["image4"]))){
|
||||||
$imageData = base64_decode($post_json["image4"],true);
|
$imageBase64 = $post_json["image4"];
|
||||||
|
|
||||||
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_'.createUniqId());
|
if (strpos($imageBase64, ',') !== false) {
|
||||||
|
$imageBase64 = explode(',', $imageBase64)[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$imageData = base64_decode($imageBase64, true);
|
||||||
|
|
||||||
|
if ($imageData === false) {
|
||||||
|
$error_message[] = 'Base64のデコードに失敗しました!(base64_decode_failed)';
|
||||||
|
} else {
|
||||||
|
$tmpFilePath = tempnam(sys_get_temp_dir(), 'upload_' . createUniqId());
|
||||||
file_put_contents($tmpFilePath, $imageData);
|
file_put_contents($tmpFilePath, $imageData);
|
||||||
|
|
||||||
|
clearstatcache(true, $tmpFilePath);
|
||||||
|
|
||||||
$Img4Files = [
|
$Img4Files = [
|
||||||
'name' => 'upload.png',
|
'name' => 'upload.png',
|
||||||
'type' => check_mime($tmpFilePath),
|
'type' => check_mime($tmpFilePath),
|
||||||
'tmp_name' => $tmpFilePath,
|
'tmp_name' => $tmpFilePath,
|
||||||
'error' => UPLOAD_ERR_OK,
|
'error' => UPLOAD_ERR_OK,
|
||||||
'size' => strlen($imageData),
|
'size' => filesize($tmpFilePath),
|
||||||
];
|
];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$Img4Files = array();
|
$Img4Files = array();
|
||||||
}
|
}
|
||||||
@@ -193,8 +241,18 @@ if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) {
|
|||||||
|
|
||||||
$video1 = array();
|
$video1 = array();
|
||||||
|
|
||||||
|
if(empty($error_message)){
|
||||||
$ueuse_result = send_ueuse($userData["userid"],$replyid,$reuseid,$ueuse,$Img1Files,$Img2Files,$Img3Files,$Img4Files,$video1,$nsfw,$isAIBWM, "../");
|
$ueuse_result = send_ueuse($userData["userid"],$replyid,$reuseid,$ueuse,$Img1Files,$Img2Files,$Img3Files,$Img4Files,$video1,$nsfw,$isAIBWM, "../");
|
||||||
|
}else{
|
||||||
|
$err = $error_message;
|
||||||
|
$response = array(
|
||||||
|
'error_code' => $err,
|
||||||
|
'success' => false
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if($ueuse_result[0] == true){
|
if($ueuse_result[0] == true){
|
||||||
$response = array(
|
$response = array(
|
||||||
|
|||||||
+7
-10
@@ -14,8 +14,7 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
@@ -27,14 +26,7 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
$error_message[] = $e->getMessage();
|
$error_message[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// データベース接続の設定
|
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
|
||||||
));
|
|
||||||
|
|
||||||
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
|
||||||
|
|
||||||
$query->execute(array(':userid' => $userId));
|
$query->execute(array(':userid' => $userId));
|
||||||
|
|
||||||
@@ -99,6 +91,11 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
+90
-21
@@ -1395,6 +1395,19 @@ main h1 {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ueuse .chotto_small {
|
||||||
|
line-height: 16px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
margin-top: auto;
|
||||||
|
margin-bottom: auto;
|
||||||
|
margin-left: 0px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-color);
|
||||||
|
text-decoration: none;
|
||||||
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
.ueuse p img {
|
.ueuse p img {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
margin-bottom: auto;
|
margin-bottom: auto;
|
||||||
@@ -4700,6 +4713,48 @@ label>input {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notification .codeblock {
|
||||||
|
width: calc(100% - 12px);
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 0px;
|
||||||
|
padding-left: 6px;
|
||||||
|
padding-right: 6px;
|
||||||
|
padding-top: 3px;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
background-color: #DDDDDD;
|
||||||
|
color: #323232;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: calc(100% - 2px);
|
||||||
|
text-decoration: none;
|
||||||
|
font-family: var(--Mono-fonts), sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification .codeblock code {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification .unixtime {
|
||||||
|
width: fit-content;
|
||||||
|
margin-left: 4px;
|
||||||
|
margin-right: 4px;
|
||||||
|
padding-left: 6px;
|
||||||
|
padding-right: 6px;
|
||||||
|
padding-top: 3px;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
background-color: #F5F5F5;
|
||||||
|
border: solid 1px #CCC;
|
||||||
|
color: #323232;
|
||||||
|
border-radius: 25px;
|
||||||
|
font-size: calc(100% - 2px);
|
||||||
|
text-decoration: none;
|
||||||
|
font-family: var(--Mono-fonts), sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
.notification h1 {
|
.notification h1 {
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
@@ -4791,6 +4846,19 @@ label>input {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notification .chotto_small {
|
||||||
|
line-height: 16px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
margin-top: auto;
|
||||||
|
margin-bottom: auto;
|
||||||
|
margin-left: 0px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-color);
|
||||||
|
text-decoration: none;
|
||||||
|
font-family: var(--Text-fonts), sans-serif;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
.notification p img {
|
.notification p img {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
margin-bottom: auto;
|
margin-bottom: auto;
|
||||||
@@ -8410,11 +8478,11 @@ noscript .noscript_modal .inner .center_text p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ueuse p {
|
.ueuse p {
|
||||||
color: var(--background-color);
|
color: var(--dark-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ru a p {
|
.ru a p {
|
||||||
color: var(--background-color);
|
color: var(--dark-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse .inline {
|
.ueuse .inline {
|
||||||
@@ -8444,25 +8512,29 @@ noscript .noscript_modal .inner .center_text p {
|
|||||||
|
|
||||||
|
|
||||||
.ueuse h1 {
|
.ueuse h1 {
|
||||||
color: var(--background-color);
|
color: var(--dark-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse h2 {
|
.ueuse h2 {
|
||||||
color: var(--background-color);
|
color: var(--dark-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse h3 {
|
.ueuse h3 {
|
||||||
color: var(--background-color);
|
color: var(--dark-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse center {
|
.ueuse center {
|
||||||
color: var(--background-color);
|
color: var(--dark-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ueuse a {
|
.ueuse a {
|
||||||
color: var(--main-color);
|
color: var(--main-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ueuse .chotto_small {
|
||||||
|
color: var(--dark-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
.ueuse .flebox .time {
|
.ueuse .flebox .time {
|
||||||
color: var(--dark-subtext-color);
|
color: var(--dark-subtext-color);
|
||||||
}
|
}
|
||||||
@@ -9188,21 +9260,8 @@ noscript .noscript_modal .inner .center_text p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.notification .inline {
|
.notification .inline {
|
||||||
width: fit-content;
|
background-color: #323232;
|
||||||
margin-left: 4px;
|
color: #F5F5F5;
|
||||||
margin-right: 4px;
|
|
||||||
padding-left: 6px;
|
|
||||||
padding-right: 6px;
|
|
||||||
padding-top: 3px;
|
|
||||||
padding-bottom: 3px;
|
|
||||||
background-color: #DDDDDD;
|
|
||||||
color: #323232;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: calc(100% - 2px);
|
|
||||||
text-decoration: none;
|
|
||||||
font-family: var(--Mono-fonts), sans-serif;
|
|
||||||
font-weight: bold;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification h1 {
|
.notification h1 {
|
||||||
@@ -9263,6 +9322,16 @@ noscript .noscript_modal .inner .center_text p {
|
|||||||
color: var(--main-color);
|
color: var(--main-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notification .chotto_small {
|
||||||
|
color: var(--dark-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification .unixtime {
|
||||||
|
background-color: #323232;
|
||||||
|
border: solid 1px #CCC;
|
||||||
|
color: #F5F5F5;
|
||||||
|
}
|
||||||
|
|
||||||
.tokonone p {
|
.tokonone p {
|
||||||
color: var(--dark-subtext-color);
|
color: var(--dark-subtext-color);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -14,9 +14,7 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($postUserid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
|
|
||||||
$result = delete_ueuse($postUniqid, $postUserid, $loginid);
|
$result = delete_ueuse($postUniqid, $postUserid, $loginid);
|
||||||
if($result[0] === true){
|
if($result[0] === true){
|
||||||
echo json_encode(['success' => true]);
|
echo json_encode(['success' => true]);
|
||||||
@@ -25,6 +23,10 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
echo json_encode(['success' => false, 'error' => '削除に失敗しました。']);
|
echo json_encode(['success' => false, 'error' => '削除に失敗しました。']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
echo json_encode(['success' => false, 'error' => '削除に失敗しました。(ERROR)']);
|
echo json_encode(['success' => false, 'error' => '削除に失敗しました。(ERROR)']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
@@ -45,8 +44,12 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}else{
|
||||||
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
if(DelAPIToken($pdo, $uniqid)){
|
if(DelAPIToken($pdo, $uniqid)){
|
||||||
echo json_encode(['success' => true, 'message' => 'アクセストークンが削除されました。']);
|
echo json_encode(['success' => true, 'message' => 'アクセストークンが削除されました。']);
|
||||||
exit;
|
exit;
|
||||||
@@ -35,6 +34,10 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['userid'])) && sa
|
|||||||
echo json_encode(['success' => false, 'error' => 'アクセストークンの削除に失敗しました。']);
|
echo json_encode(['success' => false, 'error' => 'アクセストークンの削除に失敗しました。']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
+123
-57
@@ -320,12 +320,14 @@ function uwuzuUserLoginCheck($loginid, $loginkey, $operation_permission = "user"
|
|||||||
if(hash_equals($loginkey, $userLoginKey)){
|
if(hash_equals($loginkey, $userLoginKey)){
|
||||||
if($operation_permission == "admin"){
|
if($operation_permission == "admin"){
|
||||||
if($loginResponse["admin"] == "yes"){
|
if($loginResponse["admin"] == "yes"){
|
||||||
$is_login = true;
|
// true
|
||||||
|
$is_login = $loginResponse;
|
||||||
}else{
|
}else{
|
||||||
$is_login = false;
|
$is_login = false;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$is_login = true;
|
// true
|
||||||
|
$is_login = $loginResponse;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$is_login = false;
|
$is_login = false;
|
||||||
@@ -339,6 +341,9 @@ function uwuzuUserLoginCheck($loginid, $loginkey, $operation_permission = "user"
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function is_sameUserid($userid_a, $userid_b){
|
||||||
|
return strtolower($userid_a) == strtolower($userid_b);
|
||||||
|
}
|
||||||
//---------UNIQID-MAKER---------
|
//---------UNIQID-MAKER---------
|
||||||
function Legacy_createUniqId(){
|
function Legacy_createUniqId(){
|
||||||
list($msec, $sec) = explode(" ", microtime());
|
list($msec, $sec) = explode(" ", microtime());
|
||||||
@@ -424,6 +429,51 @@ function delete_exif($extension, $path){
|
|||||||
}
|
}
|
||||||
//----------EXIF_Delete----------
|
//----------EXIF_Delete----------
|
||||||
//----------Check_Extension------
|
//----------Check_Extension------
|
||||||
|
// アップロードエラーチェッカー
|
||||||
|
function check_upload_error($uploadedFile, $saveFolder){
|
||||||
|
$saveFolder = realpath($saveFolder);
|
||||||
|
$errcode = null;
|
||||||
|
$errnum = $uploadedFile["error"];
|
||||||
|
switch ($errnum) {
|
||||||
|
case 1:
|
||||||
|
$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$errcode = "FILE_SUKOSHIDAKE_UPLOAD";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$errcode = "FILE_UPLOAD_DEKINAKATTA";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$errcode = "TMP_FOLDER_NAI";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
$errcode = "FILE_KAKIKOMI_SIPPAI";
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
$errcode = "PHPINFO()_KAKUNIN";
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
if(empty($uploadedFile['name'])){
|
||||||
|
$errcode = "FILE_NAME_NAI";
|
||||||
|
}elseif(empty($uploadedFile['size']) || $uploadedFile['size'] == 0){
|
||||||
|
$errcode = "FILE_SIZE_NAI";
|
||||||
|
}else{
|
||||||
|
if (!file_exists($uploadedFile['tmp_name'])) {
|
||||||
|
$errcode = "TMP_FILE_NAI";
|
||||||
|
} elseif (!is_writable($saveFolder)) {
|
||||||
|
$errcode = "SAVE_FOLDER_KAKIKOMI_KENNAI";
|
||||||
|
} else {
|
||||||
|
$errcode = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $errcode;
|
||||||
|
}
|
||||||
//ファイル形式チェック(画像かどうか)
|
//ファイル形式チェック(画像かどうか)
|
||||||
function check_mime($tmp_name){
|
function check_mime($tmp_name){
|
||||||
$finfo = new finfo();
|
$finfo = new finfo();
|
||||||
@@ -1450,7 +1500,8 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
} else {
|
} else {
|
||||||
// アップロードされたファイル情報
|
// アップロードされたファイル情報
|
||||||
$uploadedFile = $photo1;
|
$uploadedFile = $photo1;
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__."/../ueuseimages/");
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(!(empty($uploadedFile['tmp_name']))){
|
if(!(empty($uploadedFile['tmp_name']))){
|
||||||
if(check_mime($uploadedFile['tmp_name'])){
|
if(check_mime($uploadedFile['tmp_name'])){
|
||||||
// アップロードされたファイルの拡張子を取得
|
// アップロードされたファイルの拡張子を取得
|
||||||
@@ -1472,20 +1523,13 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
// 保存先のパスを生成
|
// 保存先のパスを生成
|
||||||
$uploadedPath = '../ueuseimages/' . $newFilename;
|
$uploadedPath = '../ueuseimages/' . $newFilename;
|
||||||
// ファイルを移動
|
// ファイルを移動
|
||||||
$result = move_uploaded_file($uploadedFile['tmp_name'], __DIR__."/".$uploadedPath);
|
$result = rename($uploadedFile['tmp_name'], __DIR__."/".$uploadedPath);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$save_photo1 = $uploadedPath; // 保存されたファイルのパスを使用
|
$save_photo1 = $uploadedPath; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__."/../ueuseimages/") ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -1501,6 +1545,9 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
}else{
|
}else{
|
||||||
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($photo2['name'])) {
|
if (empty($photo2['name'])) {
|
||||||
@@ -1511,7 +1558,8 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
}
|
}
|
||||||
// アップロードされたファイル情報
|
// アップロードされたファイル情報
|
||||||
$uploadedFile2 = $photo2;
|
$uploadedFile2 = $photo2;
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile2, __DIR__."/../ueuseimages/");
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(!(empty($uploadedFile2['tmp_name']))){
|
if(!(empty($uploadedFile2['tmp_name']))){
|
||||||
if(check_mime($uploadedFile2['tmp_name'])){
|
if(check_mime($uploadedFile2['tmp_name'])){
|
||||||
// アップロードされたファイルの拡張子を取得
|
// アップロードされたファイルの拡張子を取得
|
||||||
@@ -1532,19 +1580,12 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
// 保存先のパスを生成
|
// 保存先のパスを生成
|
||||||
$uploadedPath2 = '../ueuseimages/' . $newFilename2;
|
$uploadedPath2 = '../ueuseimages/' . $newFilename2;
|
||||||
// ファイルを移動
|
// ファイルを移動
|
||||||
$result2 = move_uploaded_file($uploadedFile2['tmp_name'], __DIR__."/".$uploadedPath2);
|
$result2 = rename($uploadedFile2['tmp_name'], __DIR__."/".$uploadedPath2);
|
||||||
if ($result2) {
|
if ($result2) {
|
||||||
$save_photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
|
$save_photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile2['error'];
|
$beforeUploadError = check_upload_error($uploadedFile2, __DIR__."/../ueuseimages/") ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -1560,6 +1601,9 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
}else{
|
}else{
|
||||||
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($photo3['name'])) {
|
if (empty($photo3['name'])) {
|
||||||
@@ -1570,7 +1614,8 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
}
|
}
|
||||||
// アップロードされたファイル情報
|
// アップロードされたファイル情報
|
||||||
$uploadedFile3 = $photo3;
|
$uploadedFile3 = $photo3;
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile3, __DIR__."/../ueuseimages/");
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(!(empty($uploadedFile3['tmp_name']))){
|
if(!(empty($uploadedFile3['tmp_name']))){
|
||||||
if(check_mime($uploadedFile3['tmp_name'])){
|
if(check_mime($uploadedFile3['tmp_name'])){
|
||||||
// アップロードされたファイルの拡張子を取得
|
// アップロードされたファイルの拡張子を取得
|
||||||
@@ -1591,19 +1636,12 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
// 保存先のパスを生成
|
// 保存先のパスを生成
|
||||||
$uploadedPath3 = '../ueuseimages/' . $newFilename3;
|
$uploadedPath3 = '../ueuseimages/' . $newFilename3;
|
||||||
// ファイルを移動
|
// ファイルを移動
|
||||||
$result3 = move_uploaded_file($uploadedFile3['tmp_name'], __DIR__."/".$uploadedPath3);
|
$result3 = rename($uploadedFile3['tmp_name'], __DIR__."/".$uploadedPath3);
|
||||||
if ($result3) {
|
if ($result3) {
|
||||||
$save_photo3 = $uploadedPath3; // 保存されたファイルのパスを使用
|
$save_photo3 = $uploadedPath3; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile3['error'];
|
$beforeUploadError = check_upload_error($uploadedFile3, __DIR__."/../ueuseimages/") ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(3)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(3)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -1619,6 +1657,9 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
}else{
|
}else{
|
||||||
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(3)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($photo4['name'])) {
|
if (empty($photo4['name'])) {
|
||||||
@@ -1629,6 +1670,8 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
}
|
}
|
||||||
// アップロードされたファイル情報
|
// アップロードされたファイル情報
|
||||||
$uploadedFile4 = $photo4;
|
$uploadedFile4 = $photo4;
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile4, __DIR__."/../ueuseimages/");
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(!(empty($uploadedFile4['tmp_name']))){
|
if(!(empty($uploadedFile4['tmp_name']))){
|
||||||
if(check_mime($uploadedFile4['tmp_name'])){
|
if(check_mime($uploadedFile4['tmp_name'])){
|
||||||
// アップロードされたファイルの拡張子を取得
|
// アップロードされたファイルの拡張子を取得
|
||||||
@@ -1649,24 +1692,17 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
// 保存先のパスを生成
|
// 保存先のパスを生成
|
||||||
$uploadedPath4 = '../ueuseimages/' . $newFilename4;
|
$uploadedPath4 = '../ueuseimages/' . $newFilename4;
|
||||||
// ファイルを移動
|
// ファイルを移動
|
||||||
$result4 = move_uploaded_file($uploadedFile4['tmp_name'], __DIR__."/".$uploadedPath4);
|
$result4 = rename($uploadedFile4['tmp_name'], __DIR__."/".$uploadedPath4);
|
||||||
if ($result4) {
|
if ($result4) {
|
||||||
$save_photo4 = $uploadedPath4; // 保存されたファイルのパスを使用
|
$save_photo4 = $uploadedPath4; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile4['error'];
|
$beforeUploadError = check_upload_error($uploadedFile4, __DIR__."/../ueuseimages/") ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(3)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(4)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
if($s3result == false){
|
if($s3result == false){
|
||||||
$error_message[] = 'アップロード失敗!(1)エラーコード: S3ERROR';
|
$error_message[] = 'アップロード失敗!(4)エラーコード: S3ERROR';
|
||||||
}else{
|
}else{
|
||||||
$save_photo4 = $s3result; // S3に保存されたファイルのパスを使用
|
$save_photo4 = $s3result; // S3に保存されたファイルのパスを使用
|
||||||
}
|
}
|
||||||
@@ -1677,6 +1713,9 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
}else{
|
}else{
|
||||||
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(4)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($video1['name'])) {
|
if (empty($video1['name'])) {
|
||||||
@@ -1684,7 +1723,8 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
} else {
|
} else {
|
||||||
// アップロードされたファイル情報
|
// アップロードされたファイル情報
|
||||||
$uploadedVideo = $video1;
|
$uploadedVideo = $video1;
|
||||||
|
$beforeUploadError = check_upload_error($uploadedVideo, __DIR__.'/../ueusevideos/');
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(!(empty($uploadedVideo['tmp_name']))){
|
if(!(empty($uploadedVideo['tmp_name']))){
|
||||||
if(check_mime_video($uploadedVideo['tmp_name'])){
|
if(check_mime_video($uploadedVideo['tmp_name'])){
|
||||||
if(AMS3_CHKS == "true"){
|
if(AMS3_CHKS == "true"){
|
||||||
@@ -1697,19 +1737,12 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
// 保存先のパスを生成
|
// 保存先のパスを生成
|
||||||
$uploadedPathVideo = '../ueusevideos/' . $newFilenameVideo;
|
$uploadedPathVideo = '../ueusevideos/' . $newFilenameVideo;
|
||||||
// ファイルを移動
|
// ファイルを移動
|
||||||
$resultVideo = move_uploaded_file($uploadedVideo['tmp_name'], __DIR__."/".$uploadedPathVideo);
|
$resultVideo = rename($uploadedVideo['tmp_name'], __DIR__."/".$uploadedPathVideo);
|
||||||
if ($resultVideo) {
|
if ($resultVideo) {
|
||||||
$save_video1 = $uploadedPathVideo; // 保存されたファイルのパスを使用
|
$save_video1 = $uploadedPathVideo; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedVideo['error'];
|
$beforeUploadError = check_upload_error($uploadedVideo, __DIR__."/../ueusevideos/") ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(3)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(5)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -1725,6 +1758,9 @@ function send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$
|
|||||||
}else{
|
}else{
|
||||||
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "ファイルがアップロードできませんでした。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(5)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($error_message)) {
|
if(empty($error_message)) {
|
||||||
@@ -3716,6 +3752,7 @@ function GetActivityPubJson($url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function GetActivityPubUser($userid, $domain) {
|
function GetActivityPubUser($userid, $domain) {
|
||||||
|
if (is_not_private_url("https://".$domain."/")) {
|
||||||
$webfingerUrl = "https://$domain/.well-known/webfinger?resource=acct:$userid@$domain";
|
$webfingerUrl = "https://$domain/.well-known/webfinger?resource=acct:$userid@$domain";
|
||||||
|
|
||||||
$webfingerJson = GetActivityPubJson($webfingerUrl);
|
$webfingerJson = GetActivityPubJson($webfingerUrl);
|
||||||
@@ -3763,6 +3800,25 @@ function GetActivityPubUser($userid, $domain) {
|
|||||||
'follower' => '',
|
'follower' => '',
|
||||||
'raw' => $actorJson
|
'raw' => $actorJson
|
||||||
];
|
];
|
||||||
|
}else{
|
||||||
|
return [
|
||||||
|
'userid' => null,
|
||||||
|
'username' => null,
|
||||||
|
'profile' => null,
|
||||||
|
'id' => null,
|
||||||
|
'inbox' => null,
|
||||||
|
'outbox' => null,
|
||||||
|
'followers' => null,
|
||||||
|
'iconname' => "../img/deficon/icon.png",
|
||||||
|
'headname' => "../img/defhead/head.png",
|
||||||
|
'datetime' => null,
|
||||||
|
'role' => 'user',
|
||||||
|
'other_settings' => '{}',
|
||||||
|
'follow' => '',
|
||||||
|
'follower' => '',
|
||||||
|
'raw' => ''
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function FormatUeuseItem(array $value, string $myblocklist, string $mybookmark, $pdo, string $userId): ?array {
|
function FormatUeuseItem(array $value, string $myblocklist, string $mybookmark, $pdo, string $userId): ?array {
|
||||||
@@ -4219,5 +4275,15 @@ function sqlBlockAccountList($column, $myblocklist){
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function is_not_private_url($url) {
|
||||||
|
$parts = parse_url($url);
|
||||||
|
if (!isset($parts['host'])) return false;
|
||||||
|
|
||||||
|
$ip = gethostbyname($parts['host']);
|
||||||
|
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -15,8 +15,7 @@ if (safetext(isset($_POST['emoji'])) && safetext(isset($_POST['userid'])) && saf
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -70,6 +69,10 @@ if (safetext(isset($_POST['emoji'])) && safetext(isset($_POST['userid'])) && saf
|
|||||||
);
|
);
|
||||||
echo json_encode($item, JSON_UNESCAPED_UNICODE);
|
echo json_encode($item, JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ if (safetext(isset($_POST['get_account'])) && safetext(isset($_POST['userid']))
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -65,6 +64,10 @@ if (safetext(isset($_POST['get_account'])) && safetext(isset($_POST['userid']))
|
|||||||
"users" => null
|
"users" => null
|
||||||
], JSON_UNESCAPED_UNICODE);
|
], JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
+5
-2
@@ -27,8 +27,7 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['reusetext'])) &&
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
$reusedate = date("Y-m-d H:i:s");
|
$reusedate = date("Y-m-d H:i:s");
|
||||||
|
|
||||||
//ユーズの情報を取得
|
//ユーズの情報を取得
|
||||||
@@ -75,6 +74,10 @@ if (safetext(isset($_POST['uniqid'])) && safetext(isset($_POST['reusetext'])) &&
|
|||||||
echo json_encode(['success' => false, 'error' => 'リユーズに失敗しました。']);
|
echo json_encode(['success' => false, 'error' => 'リユーズに失敗しました。']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
+21
-20
@@ -38,7 +38,8 @@ if (safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) &
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userid, $is_login["userid"]) === true){
|
||||||
|
$userid = $is_login["userid"];
|
||||||
|
|
||||||
$settings_type = safetext($_POST['settings_type']);
|
$settings_type = safetext($_POST['settings_type']);
|
||||||
|
|
||||||
@@ -46,6 +47,8 @@ if (safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) &
|
|||||||
if(isset($_FILES["data"])){
|
if(isset($_FILES["data"])){
|
||||||
if (!(empty($_FILES['data']['name']))) {
|
if (!(empty($_FILES['data']['name']))) {
|
||||||
$uploadedFile = $_FILES['data'];
|
$uploadedFile = $_FILES['data'];
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../usericons/');
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(check_mime($uploadedFile['tmp_name'])){
|
if(check_mime($uploadedFile['tmp_name'])){
|
||||||
$extension = convert_mime(check_mime($uploadedFile['tmp_name']));
|
$extension = convert_mime(check_mime($uploadedFile['tmp_name']));
|
||||||
delete_exif($extension, $uploadedFile['tmp_name']);
|
delete_exif($extension, $uploadedFile['tmp_name']);
|
||||||
@@ -75,15 +78,8 @@ if (safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) &
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../usericons/') ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -96,6 +92,9 @@ if (safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) &
|
|||||||
}else{
|
}else{
|
||||||
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$error_message[] = 'アイコン画像を選択してください(PHOTO_SELECT_PLEASE)';
|
$error_message[] = 'アイコン画像を選択してください(PHOTO_SELECT_PLEASE)';
|
||||||
}
|
}
|
||||||
@@ -138,8 +137,10 @@ if (safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) &
|
|||||||
if(isset($_FILES["data"])){
|
if(isset($_FILES["data"])){
|
||||||
if (!(empty($_FILES['data']['name']))) {
|
if (!(empty($_FILES['data']['name']))) {
|
||||||
$uploadedFile = $_FILES['data'];
|
$uploadedFile = $_FILES['data'];
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../userheads/');
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(check_mime($uploadedFile['tmp_name'])){
|
if(check_mime($uploadedFile['tmp_name'])){
|
||||||
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
|
$extension = convert_mime(check_mime($uploadedFile['tmp_name']));
|
||||||
delete_exif($extension, $uploadedFile['tmp_name']);
|
delete_exif($extension, $uploadedFile['tmp_name']);
|
||||||
resizeImage($uploadedFile['tmp_name'], 2048, 1024);
|
resizeImage($uploadedFile['tmp_name'], 2048, 1024);
|
||||||
|
|
||||||
@@ -167,15 +168,8 @@ if (safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) &
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$headName = $uploadedPath; // 保存されたファイルのパスを使用
|
$headName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/../userheads/') ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -188,6 +182,9 @@ if (safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) &
|
|||||||
}else{
|
}else{
|
||||||
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$error_message[] = 'アイコン画像を選択してください(PHOTO_SELECT_PLEASE)';
|
$error_message[] = 'アイコン画像を選択してください(PHOTO_SELECT_PLEASE)';
|
||||||
}
|
}
|
||||||
@@ -225,6 +222,10 @@ if (safetext(isset($_POST['userid'])) && safetext(isset($_POST['account_id'])) &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
||||||
|
|||||||
+5
-2
@@ -27,8 +27,7 @@ if (safetext(isset($_POST['ueuse'])) && safetext(isset($_POST['userid'])) && saf
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
//ユーザーの認証情報を取得
|
//ユーザーの認証情報を取得
|
||||||
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||||
$query->execute(array(':userid' => $userid));
|
$query->execute(array(':userid' => $userid));
|
||||||
@@ -97,6 +96,10 @@ if (safetext(isset($_POST['ueuse'])) && safetext(isset($_POST['userid'])) && saf
|
|||||||
echo json_encode(['success' => false, 'error' => 'ユーズに失敗しました。']);
|
echo json_encode(['success' => false, 'error' => 'ユーズに失敗しました。']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
+34
-22
@@ -355,21 +355,20 @@ function formatMarkdown(text) {
|
|||||||
|
|
||||||
// a_link
|
// a_link
|
||||||
text = text.replace(/(https:\/\/[\w!?\/+\-_~;.,*&@#$%()+|https:\/\/[ぁ-んァ-ヶ一ー-龠々\w\-\/?=&%.]+)/g, function (url) {
|
text = text.replace(/(https:\/\/[\w!?\/+\-_~;.,*&@#$%()+|https:\/\/[ぁ-んァ-ヶ一ー-龠々\w\-\/?=&%.]+)/g, function (url) {
|
||||||
const escapedUrl = url;
|
const no_https_link = url.replace("https://", "");
|
||||||
const no_https_link = escapedUrl.replace("https://", "");
|
|
||||||
let linkText = no_https_link;
|
let linkText = no_https_link;
|
||||||
|
|
||||||
if (no_https_link.length > 48) {
|
if (no_https_link.length > 48) {
|
||||||
linkText = no_https_link.substring(0, 48) + '...';
|
linkText = no_https_link.substring(0, 48) + '...';
|
||||||
}
|
}
|
||||||
|
const html = `<a href="${url}" target="_blank" rel="noopener">${linkText}</a>`;
|
||||||
return `<a href="${escapedUrl}" target="_blank" rel="noopener">${linkText}</a>`;
|
return createPlaceholder(html);
|
||||||
});
|
});
|
||||||
|
|
||||||
// ハッシュタグ
|
// ハッシュタグ
|
||||||
text = text.replace(/(^|[^a-zA-Z0-9_])#([a-zA-Z0-9ぁ-んァ-ン一-龥ー_]+)/gu, function (match, before, tag) {
|
text = text.replace(/(^|[^a-zA-Z0-9_])#([a-zA-Z0-9ぁ-んァ-ン一-龥ー_]+)/gu, function (match, before, tag) {
|
||||||
const encodedTag = encodeURIComponent("#" + tag);
|
const encodedTag = encodeURIComponent("#" + tag);
|
||||||
return `${before}<a href="/search?q=${encodedTag}" class="hashtags">#${tag}</a>`;
|
const html = `${before}<a href="/search?q=${encodedTag}" class="hashtags">#${tag}</a>`;
|
||||||
|
return createPlaceholder(html);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 独自構文
|
// 独自構文
|
||||||
@@ -390,6 +389,7 @@ function formatMarkdown(text) {
|
|||||||
.replace(/~~(.+?)~~/g, '<s>$1</s>')
|
.replace(/~~(.+?)~~/g, '<s>$1</s>')
|
||||||
.replace(/^>>> ?(.*)$/gm, '<span class="quote">$1</span>')
|
.replace(/^>>> ?(.*)$/gm, '<span class="quote">$1</span>')
|
||||||
.replace(/\|\|(.+?)\|\|/g, '<span class="blur">$1</span>')
|
.replace(/\|\|(.+?)\|\|/g, '<span class="blur">$1</span>')
|
||||||
|
.replace(/^-# (.+)/gm, '<p class="chotto_small">$1</p>')
|
||||||
.replace(/^# (.+)/gm, '<h1>$1</h1>')
|
.replace(/^# (.+)/gm, '<h1>$1</h1>')
|
||||||
.replace(/^## (.+)/gm, '<h2>$1</h2>')
|
.replace(/^## (.+)/gm, '<h2>$1</h2>')
|
||||||
.replace(/^### (.+)/gm, '<h3>$1</h3>')
|
.replace(/^### (.+)/gm, '<h3>$1</h3>')
|
||||||
@@ -412,17 +412,17 @@ function formatMarkdown(text) {
|
|||||||
return final;
|
return final;
|
||||||
}
|
}
|
||||||
|
|
||||||
function YouTube_and_nicovideo_Links(postText) {
|
async function YouTube_and_nicovideo_Links(postText) {
|
||||||
const urlPattern = /(https:\/\/[^\s<>\[\]'"“”]+)/g;
|
const urlPattern = /(https:\/\/[^\s<>\[\]'"“”]+)/g;
|
||||||
const urls = postText.match(urlPattern);
|
const urls = postText.match(urlPattern);
|
||||||
let embedCode = '';
|
let embedCode = '';
|
||||||
|
|
||||||
if (!urls) return null;
|
if (!urls) return null;
|
||||||
|
|
||||||
let embeddedOnce = false; // ← 埋め込みが1回されたかどうか
|
let embeddedOnce = false;
|
||||||
|
|
||||||
urls.forEach(url => {
|
for (const url of urls) {
|
||||||
if (embeddedOnce) return; // ← すでに埋め込みしたらスキップ
|
if (embeddedOnce) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const parsed = new URL(url);
|
const parsed = new URL(url);
|
||||||
@@ -452,7 +452,6 @@ function YouTube_and_nicovideo_Links(postText) {
|
|||||||
embedCode = `<div class="youtube_and_nicovideo_player"><iframe src="https://www.youtube-nocookie.com/embed/${videoId}?start=${videoTime}" rel="0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></div>`;
|
embedCode = `<div class="youtube_and_nicovideo_player"><iframe src="https://www.youtube-nocookie.com/embed/${videoId}?start=${videoTime}" rel="0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></div>`;
|
||||||
embeddedOnce = true;
|
embeddedOnce = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (['nicovideo.jp', 'nico.ms'].includes(host)) {
|
} else if (['nicovideo.jp', 'nico.ms'].includes(host)) {
|
||||||
if (parsed.pathname.includes('/watch/')) {
|
if (parsed.pathname.includes('/watch/')) {
|
||||||
videoId = parsed.pathname.split('/watch/')[1];
|
videoId = parsed.pathname.split('/watch/')[1];
|
||||||
@@ -471,13 +470,24 @@ function YouTube_and_nicovideo_Links(postText) {
|
|||||||
embedCode = `<div class="youtube_and_nicovideo_player"><iframe src="https://embed.nicovideo.jp/watch/${videoId}?from=${videoTime}" frameborder="0" allowfullscreen></iframe></div>`;
|
embedCode = `<div class="youtube_and_nicovideo_player"><iframe src="https://embed.nicovideo.jp/watch/${videoId}?from=${videoTime}" frameborder="0" allowfullscreen></iframe></div>`;
|
||||||
embeddedOnce = true;
|
embeddedOnce = true;
|
||||||
}
|
}
|
||||||
} else {
|
}else if (['soundcloud.com', 'on.soundcloud.com'].includes(host)) {
|
||||||
embedCode = null
|
const oembedUrl = `https://soundcloud.com/oembed?format=json&maxheight=400&url=${encodeURIComponent(url)}`;
|
||||||
|
|
||||||
|
const response = await $.ajax({
|
||||||
|
url: oembedUrl,
|
||||||
|
method: 'GET',
|
||||||
|
dataType: 'json'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response && response.html) {
|
||||||
|
embedCode = `<div class="youtube_and_nicovideo_player">${response.html}</div>`;
|
||||||
|
embeddedOnce = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// 無視
|
// 無視
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
return embedCode;
|
return embedCode;
|
||||||
}
|
}
|
||||||
@@ -946,23 +956,25 @@ async function createUeuseHtml(ueuse, selectedUniqid = null) {
|
|||||||
|
|
||||||
if (ueuse["type"] == "Reuse") {
|
if (ueuse["type"] == "Reuse") {
|
||||||
if (ueuse["ueuse"].length > 0) {
|
if (ueuse["ueuse"].length > 0) {
|
||||||
if (YouTube_and_nicovideo_Links(ueuse["ueuse"])) {
|
const embed = await YouTube_and_nicovideo_Links(ueuse["ueuse"]);
|
||||||
contentHtml = contentHtml + YouTube_and_nicovideo_Links(ueuse["ueuse"]);
|
if (embed) {
|
||||||
|
contentHtml = contentHtml + embed;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ueuse["reuse"] != null) {
|
if (ueuse["reuse"] != null) {
|
||||||
if (YouTube_and_nicovideo_Links(ueuse["reuse"]["ueuse"])) {
|
const embed = await YouTube_and_nicovideo_Links(ueuse["reuse"]["ueuse"]);
|
||||||
contentHtml = contentHtml + YouTube_and_nicovideo_Links(ueuse["reuse"]["ueuse"]);
|
if (embed) {
|
||||||
|
contentHtml = contentHtml + embed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (YouTube_and_nicovideo_Links(ueuse["ueuse"])) {
|
const embed = await YouTube_and_nicovideo_Links(ueuse["ueuse"]);
|
||||||
contentHtml = contentHtml + YouTube_and_nicovideo_Links(ueuse["ueuse"]);
|
if (embed) {
|
||||||
|
contentHtml = contentHtml + embed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var favbox = `
|
var favbox = `
|
||||||
<hr>
|
<hr>
|
||||||
<div class="favbox">
|
<div class="favbox">
|
||||||
|
|||||||
+13
-1
@@ -78,10 +78,14 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if(empty($domain)) {
|
if(empty($domain)) {
|
||||||
$error_message[] = '移行元のサーバードメインを入力してください。(INPUT_PLEASE)';
|
$error_message[] = '移行元のサーバードメインを入力してください。(INPUT_PLEASE)';
|
||||||
}else{
|
}else{
|
||||||
|
if (is_not_private_url("https://".$domain."/")) {
|
||||||
$domain_response = @file_get_contents("https://".$domain."/");
|
$domain_response = @file_get_contents("https://".$domain."/");
|
||||||
if (empty($domain_response)) {
|
if (empty($domain_response)) {
|
||||||
$error_message[] = '入力されたドメインに接続できませんでした。(INPUT_PLEASE)';
|
$error_message[] = '入力されたドメインに接続できませんでした。(INPUT_PLEASE)';
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = '入力されたドメインに接続できませんでした。(BAD_REQUEST)';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($check_code)) {
|
if(empty($check_code)) {
|
||||||
@@ -203,8 +207,8 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if($json_account_data == false){
|
if($json_account_data == false){
|
||||||
$error_message[] = "アカウントの移行を最初からやり直してください。(MIGRATION_SORRY)";
|
$error_message[] = "アカウントの移行を最初からやり直してください。(MIGRATION_SORRY)";
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
//アイコン&ヘッダー
|
//アイコン&ヘッダー
|
||||||
|
if (is_not_private_url("https://".$json_account_data["userdata"]["user_icon"]."/")) {
|
||||||
$icondata = file_get_contents($json_account_data["userdata"]["user_icon"]);
|
$icondata = file_get_contents($json_account_data["userdata"]["user_icon"]);
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$mime_type = finfo_buffer($finfo, $icondata);
|
$mime_type = finfo_buffer($finfo, $icondata);
|
||||||
@@ -256,7 +260,12 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$uploadedFile['error'].'';
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$uploadedFile['error'].'';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = '入力されたドメインに接続できませんでした。(BAD_REQUEST)';
|
||||||
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
|
if (is_not_private_url("https://".$json_account_data["userdata"]["user_header"]."/")) {
|
||||||
$headdata = file_get_contents($json_account_data["userdata"]["user_header"]);
|
$headdata = file_get_contents($json_account_data["userdata"]["user_header"]);
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$mime_type = finfo_buffer($finfo, $headdata);
|
$mime_type = finfo_buffer($finfo, $headdata);
|
||||||
@@ -308,6 +317,9 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$uploadedFile['error'].'';
|
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$uploadedFile['error'].'';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = '入力されたドメインに接続できませんでした。(BAD_REQUEST)';
|
||||||
|
}
|
||||||
|
|
||||||
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
$query = $pdo->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||||
$query->execute(array(':userid' => $new_userid));
|
$query->execute(array(':userid' => $new_userid));
|
||||||
|
|||||||
@@ -171,15 +171,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$iconName = $uploadedPath;
|
$iconName = $uploadedPath;
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$error_message[] = 'アップロード失敗!(1)エラーコード: ERROR';
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$uploadedFile['error'].'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -191,6 +183,8 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$uploadedFile = $_FILES['image'];
|
$uploadedFile = $_FILES['image'];
|
||||||
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/usericons/');
|
||||||
|
if($beforeUploadError === null){
|
||||||
if(!(empty($uploadedFile['tmp_name']))){
|
if(!(empty($uploadedFile['tmp_name']))){
|
||||||
if(check_mime($uploadedFile['tmp_name'])){
|
if(check_mime($uploadedFile['tmp_name'])){
|
||||||
$extension = convert_mime(check_mime($uploadedFile['tmp_name']));
|
$extension = convert_mime(check_mime($uploadedFile['tmp_name']));
|
||||||
@@ -211,15 +205,8 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
$iconName = $uploadedPath; // 保存されたファイルのパスを使用
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$beforeUploadError = check_upload_error($uploadedFile, __DIR__.'/usericons/') ?? "ERROR";
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$errcode.'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
@@ -233,6 +220,9 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
$error_message[] = "使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$error_message[] = 'アップロード失敗!(1)エラーコード:' .$beforeUploadError.'';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------[header image]-------------------------------
|
//----------------[header image]-------------------------------
|
||||||
@@ -247,15 +237,7 @@ if( !empty($_POST['btn_submit']) ) {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$headName = $uploadedPath;
|
$headName = $uploadedPath;
|
||||||
} else {
|
} else {
|
||||||
$errnum = $uploadedFile['error'];
|
$error_message[] = 'アップロード失敗!(1)エラーコード: ERROR';
|
||||||
if($errnum === 1){$errcode = "FILE_DEKASUGUI_PHP_INI_KAKUNIN";}
|
|
||||||
if($errnum === 2){$errcode = "FILE_DEKASUGUI_HTML_KAKUNIN";}
|
|
||||||
if($errnum === 3){$errcode = "FILE_SUKOSHIDAKE_UPLOAD";}
|
|
||||||
if($errnum === 4){$errcode = "FILE_UPLOAD_DEKINAKATTA";}
|
|
||||||
if($errnum === 6){$errcode = "TMP_FOLDER_NAI";}
|
|
||||||
if($errnum === 7){$errcode = "FILE_KAKIKOMI_SIPPAI";}
|
|
||||||
if($errnum === 8){$errcode = "PHPINFO()_KAKUNIN";}
|
|
||||||
$error_message[] = 'アップロード失敗!(2)エラーコード:' .$uploadedFile['error'].'';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($s3result)){
|
if(isset($s3result)){
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -144,6 +143,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
|
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -130,6 +129,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
|
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -268,6 +267,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
|
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -127,6 +126,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
|
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
$myblocklist = getUserData($pdo, $userid)["blocklist"];
|
$myblocklist = getUserData($pdo, $userid)["blocklist"];
|
||||||
|
|
||||||
$itemsPerPage = 15; // 1ページあたりの投稿数
|
$itemsPerPage = 15; // 1ページあたりの投稿数
|
||||||
@@ -139,6 +138,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
);
|
);
|
||||||
echo json_encode($item, JSON_UNESCAPED_UNICODE);
|
echo json_encode($item, JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -193,6 +192,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
echo json_encode($item, JSON_UNESCAPED_UNICODE);
|
echo json_encode($item, JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
if(empty($uniqid)){
|
if(empty($uniqid)){
|
||||||
echo json_encode(['success' => false, 'error' => 'no_ueuse']);
|
echo json_encode(['success' => false, 'error' => 'no_ueuse']);
|
||||||
exit;
|
exit;
|
||||||
@@ -144,6 +143,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
|
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -162,6 +161,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
|
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -159,6 +158,10 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
|
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
echo json_encode(['success' => false, 'error' => 'bad_request']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($userId, $is_login["userid"]) === true){
|
||||||
|
|
||||||
// データベースに接続
|
// データベースに接続
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
@@ -243,6 +242,11 @@ if (safetext(isset($_POST['page'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
|
|
||||||
$pdo = null;
|
$pdo = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$item = array(
|
$item = array(
|
||||||
"success" => false,
|
"success" => false,
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
使っている方ならわかると思いますが普通のSNSです!
|
使っている方ならわかると思いますが普通のSNSです!
|
||||||
これと言った大きな特徴もなく、平凡で、なんとも言えないSNSです…
|
これと言った大きな特徴もなく、平凡で、なんとも言えないSNSです…
|
||||||
あっ!特徴かもしれないのが誰でもサーバーを建てられることです!!!
|
あっ!特徴かもしれないのが誰でもサーバーを建てられることです!!!
|
||||||
詳細はdocs.uwuzu.xyzを確認してください!
|
SNSを作れるソフトウェアみたいな...?
|
||||||
|
よければ詳細はdocs.uwuzu.comを確認してください!
|
||||||
### 1.1 uwuzuのよみは?
|
### 1.1 uwuzuのよみは?
|
||||||
uwuzuの読みはゆずです。
|
uwuzuの読みはゆずです。
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ uwuzuはPHPとJS、HTML(プログラミング言語じゃないか)、CSSで作
|
|||||||
使用している画像は友人またはGoogle Icons様より使わせて頂いております!
|
使用している画像は友人またはGoogle Icons様より使わせて頂いております!
|
||||||
|
|
||||||
## 5. サーバーの建て方
|
## 5. サーバーの建て方
|
||||||
docs.uwuzu.xyzをご確認いただくかgithubのreadme.mdをよんでください!
|
docs.uwuzu.comをご確認いただくかgithubのreadme.mdをよんでください!
|
||||||
|
|
||||||
## 6. Android、iOS、その他OS向けのアプリについて
|
## 6. Android、iOS、その他OS向けのアプリについて
|
||||||
残念ですが今現在は公式アプリ等はなく、Webブラウザからお楽しみいただけます。
|
残念ですが今現在は公式アプリ等はなく、Webブラウザからお楽しみいただけます。
|
||||||
@@ -98,4 +99,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
## 更新情報
|
## 更新情報
|
||||||
編集者 : daichimarukana
|
編集者 : daichimarukana
|
||||||
最終更新日 : 2025/08/05 0:45
|
最終更新日 : 2026/04/05 16:32
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
uwuzu
|
uwuzu
|
||||||
1.6.11
|
1.6.12
|
||||||
2026/01/05
|
2026/04/22
|
||||||
daichimarukana,putonfps
|
daichimarukana,putonfps
|
||||||
@@ -1,6 +1,17 @@
|
|||||||
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
||||||
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
||||||
|
|
||||||
|
## Version 1.6.12 (Hapuego)
|
||||||
|
2026/01/05
|
||||||
|
fix: 設定画面でヘッダーの更新時にアイコンに関するエラーが発生してしまう可能性のある問題を修正しました!
|
||||||
|
fix: 設定変更APIでアイコン・ヘッダーの更新失敗時にエラーが正常に返されない恐れのある問題を修正しました!
|
||||||
|
fix: APIを通じて画像を投稿できない恐れのある問題を修正しました!
|
||||||
|
fix: レンタルサーバーなどの環境で正常にサーバーの残り空き容量などが取得できず、エラーが起きてしまう恐れのある問題を修正しました!
|
||||||
|
fix: ユーズに含まれているURLに「_」(アンダーバー)が含まれていた際に「_」が一件のみでも斜体判定となってしまいURLが正しく変換されない問題を修正しました!
|
||||||
|
fix: 重大な脆弱性を修正しました。
|
||||||
|
new: Markdownを強化し、小さく表示「-# [ここにテキスト]」を実装しました!
|
||||||
|
new: Soundcloud埋め込みに対応しました!
|
||||||
|
|
||||||
## Version 1.6.11 (Hapuego)
|
## Version 1.6.11 (Hapuego)
|
||||||
2026/01/05
|
2026/01/05
|
||||||
fix: 背景透過画像が投稿できない問題を修正しました!
|
fix: 背景透過画像が投稿できない問題を修正しました!
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ if (safetext(isset($_POST['code'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($postUserid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
@@ -56,6 +55,10 @@ if (safetext(isset($_POST['code'])) && safetext(isset($_POST['userid'])) && safe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
echo json_encode(['success' => false, 'error' => '削除に失敗しました。(sess_err)']);
|
echo json_encode(['success' => false, 'error' => '削除に失敗しました。(sess_err)']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ if (isset($_FILES['update_zip']) && isset($_POST['userid']) && isset($_POST['acc
|
|||||||
if ($is_login === false) {
|
if ($is_login === false) {
|
||||||
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}elseif(is_sameUserid($postUserid, $is_login["userid"]) === true){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$option = array(
|
$option = array(
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
@@ -88,6 +87,10 @@ if (isset($_FILES['update_zip']) && isset($_POST['userid']) && isset($_POST['acc
|
|||||||
}else{
|
}else{
|
||||||
echo json_encode(['success' => false, 'error' => 'データベースの接続に失敗しました。(ERROR)']);
|
echo json_encode(['success' => false, 'error' => 'データベースの接続に失敗しました。(ERROR)']);
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode(['success' => false, 'error' => '認証に失敗しました。(AUTH_INVALID)']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
echo json_encode(['success' => false, 'error' => '読み込みに失敗しました。2(ROADING_ERROR)']);
|
echo json_encode(['success' => false, 'error' => '読み込みに失敗しました。2(ROADING_ERROR)']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -171,8 +171,9 @@ if(!empty($pdo)){
|
|||||||
|
|
||||||
if(function_exists("disk_free_space")){
|
if(function_exists("disk_free_space")){
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
|
$totalRaw = @disk_total_space('C:');
|
||||||
|
if($totalRaw !== false){
|
||||||
$disk = true;
|
$disk = true;
|
||||||
$totalRaw = disk_total_space('C:');
|
|
||||||
$diskTotal = ($totalRaw > 0) ? (int)$totalRaw / 1024 / 1024 : 0;
|
$diskTotal = ($totalRaw > 0) ? (int)$totalRaw / 1024 / 1024 : 0;
|
||||||
$diskFree = (int)disk_free_space('C:') / 1024 / 1024;
|
$diskFree = (int)disk_free_space('C:') / 1024 / 1024;
|
||||||
$diskUmari = $diskTotal - $diskFree;
|
$diskUmari = $diskTotal - $diskFree;
|
||||||
@@ -184,9 +185,18 @@ if(function_exists("disk_free_space")){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$loadAve = null;
|
$loadAve = null;
|
||||||
|
}else{
|
||||||
|
$disk = false;
|
||||||
|
$diskFree = 5000;
|
||||||
|
$diskUmari = 5000;
|
||||||
|
$diskTotal = 10000;
|
||||||
|
$disk_over90p = false;
|
||||||
|
$loadAve = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$totalRaw = @disk_total_space('/');
|
||||||
|
if($totalRaw !== false){
|
||||||
$disk = true;
|
$disk = true;
|
||||||
$totalRaw = disk_total_space('/');
|
|
||||||
$diskTotal = ($totalRaw > 0) ? (int)$totalRaw / 1024 / 1024 : 0;
|
$diskTotal = ($totalRaw > 0) ? (int)$totalRaw / 1024 / 1024 : 0;
|
||||||
$diskFree = (int)disk_free_space('/') / 1024 / 1024;
|
$diskFree = (int)disk_free_space('/') / 1024 / 1024;
|
||||||
$diskUmari = $diskTotal - $diskFree;
|
$diskUmari = $diskTotal - $diskFree;
|
||||||
@@ -202,6 +212,18 @@ if(function_exists("disk_free_space")){
|
|||||||
} else {
|
} else {
|
||||||
$loadAve = null;
|
$loadAve = null;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$disk = false;
|
||||||
|
$diskFree = 5000;
|
||||||
|
$diskUmari = 5000;
|
||||||
|
$diskTotal = 10000;
|
||||||
|
$disk_over90p = false;
|
||||||
|
if(function_exists("sys_getloadavg")){
|
||||||
|
$loadAve = sys_getloadavg()[0];
|
||||||
|
}else{
|
||||||
|
$loadAve = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$disk = false;
|
$disk = false;
|
||||||
|
|||||||
+34
-3
@@ -1,12 +1,43 @@
|
|||||||
{
|
{
|
||||||
"software": "uwuzu",
|
"software": "uwuzu",
|
||||||
"version": "1.6.11",
|
"version": "1.6.12",
|
||||||
"release_date": "2026/01/05",
|
"release_date": "2026/04/22",
|
||||||
"release_notes": "このアップデートには、背景透過画像が投稿できないバグの修正が含まれます!\n詳細はリリースノートをご確認ください。",
|
"release_notes": "このアップデートには、とっても重大な脆弱性の修正が含まれます!また、一部新機能の追加、バグ修正が含まれます。\n詳細はリリースノートをご確認ください。",
|
||||||
"notices": "アップデート前にデータのバックアップを行うことをおすすめします!",
|
"notices": "アップデート前にデータのバックアップを行うことをおすすめします!",
|
||||||
"files": {
|
"files": {
|
||||||
"overwrite": [
|
"overwrite": [
|
||||||
|
"/admin/addadmin.php",
|
||||||
|
"/api/me/settings/index.php",
|
||||||
|
"/api/ueuse/create.php",
|
||||||
|
"/css/home.css",
|
||||||
|
"/js/view_function.js",
|
||||||
|
"/new.php",
|
||||||
|
"/settings_admin/overview_admin.php",
|
||||||
|
"/uwuzu_error_code.txt",
|
||||||
|
"/abi/addabi.php",
|
||||||
|
"/bookmark/bookmark.php",
|
||||||
|
"/delete/delete.php",
|
||||||
|
"/favorite/favorite.php",
|
||||||
|
"/function/delete_apitoken.php",
|
||||||
"/function/function.php",
|
"/function/function.php",
|
||||||
|
"/function/get_customemoji.php",
|
||||||
|
"/function/get_userid.php",
|
||||||
|
"/function/reuse.php",
|
||||||
|
"/function/settings.php",
|
||||||
|
"/function/ueuse.php",
|
||||||
|
"/migration/index.php",
|
||||||
|
"/nextpage/bookmarktimeline.php",
|
||||||
|
"/nextpage/followtimeline.php",
|
||||||
|
"/nextpage/foryoutimeline.php",
|
||||||
|
"/nextpage/localtimeline.php",
|
||||||
|
"/nextpage/notification.php",
|
||||||
|
"/nextpage/searchtimeline.php",
|
||||||
|
"/nextpage/ueusetimeline.php",
|
||||||
|
"/nextpage/userliketimeline.php",
|
||||||
|
"/nextpage/usermediatimeline.php",
|
||||||
|
"/nextpage/usertimeline.php",
|
||||||
|
"/settings_admin/api/code_delete.php",
|
||||||
|
"/settings_admin/api/update_query.php",
|
||||||
"/server/uwuzuabout.txt",
|
"/server/uwuzuabout.txt",
|
||||||
"/server/uwuzuinfo.txt",
|
"/server/uwuzuinfo.txt",
|
||||||
"/server/uwuzurelease.txt"
|
"/server/uwuzurelease.txt"
|
||||||
|
|||||||
@@ -32,15 +32,20 @@ could_not_complete - 処理を完了できなかった場合に表示されま
|
|||||||
user_not_frozen_cant_be_banned - APIからユーザーをBANしようとした際に、ユーザーが事前に凍結されていない場合に発生するエラーです。
|
user_not_frozen_cant_be_banned - APIからユーザーをBANしようとした際に、ユーザーが事前に凍結されていない場合に発生するエラーです。
|
||||||
method_not_allowed - 禁止されたHTTPメゾットで要求があった場合に表示されます。
|
method_not_allowed - 禁止されたHTTPメゾットで要求があった場合に表示されます。
|
||||||
this_API_is_ws_only - WebsocketAPIがWebsocket以外の方法でアクセスされた場合に表示されます。
|
this_API_is_ws_only - WebsocketAPIがWebsocket以外の方法でアクセスされた場合に表示されます。
|
||||||
|
base64_decode_failed - Base64デコードに失敗した場合に表示されます。
|
||||||
|
|
||||||
----------(UWUZU ERR CODE)----------
|
----------(UWUZU ERR CODE)----------
|
||||||
FILE_DEKASUGUI_PHP_INI_KAKUNIN - php.iniで設定されているファイルサイズ上限を上回っている時に表示されます。
|
FILE_DEKASUGUI_PHP_INI_KAKUNIN - php.iniで設定されているファイルサイズ上限を上回っている時に表示されます。
|
||||||
FILE_DEKASUGUI_HTML_KAKUNIN - HTMLフォームで指定されているファイルサイズ上限を上回っている時に表示されます。
|
FILE_DEKASUGUI_HTML_KAKUNIN - HTMLフォームで指定されているファイルサイズ上限を上回っている時に表示されます。
|
||||||
FILE_SUKOSHIDAKE_UPLOAD - アップロードされたファイルが一部のみアップロードされた場合に表示されます。
|
FILE_SUKOSHIDAKE_UPLOAD - アップロードされたファイルが一部のみアップロードされた場合に表示されます。
|
||||||
FILE_UPLOAD_DEKINAKATTA - ファイルのアップロードができない場合に表示されます。
|
FILE_UPLOAD_DEKINAKATTA - ファイルのアップロードができない場合に表示されます。
|
||||||
|
FILE_NAME_NAI - ファイル名が無い場合に表示されます。
|
||||||
|
FILE_PATH_NAI - ファイルパスが無い場合に表示されます。
|
||||||
|
FILE_SIZE_NAI - ファイルサイズが無い場合に表示されます。
|
||||||
TMP_FOLDER_NAI - テンポラリフォルダがない場合に表示されます。
|
TMP_FOLDER_NAI - テンポラリフォルダがない場合に表示されます。
|
||||||
FILE_KAKIKOMI_SIPPAI - 記憶装置へのファイル書き込みに失敗した場合に表示されます。
|
FILE_KAKIKOMI_SIPPAI - 記憶装置へのファイル書き込みに失敗した場合に表示されます。
|
||||||
PHPINFO()_KAKUNIN - PHPの拡張モジュールによりアップロードが中止された場合に表示されます。
|
PHPINFO()_KAKUNIN - PHPの拡張モジュールによりアップロードが中止された場合に表示されます。
|
||||||
|
SAVE_FOLDER_KAKIKOMI_KENNAI - フォルダへの書き込み権が無い場合に表示されます。
|
||||||
|
|
||||||
INVITATION_CODE_INPUT_PLEASE - 招待コードが入力されていない時に表示されます。
|
INVITATION_CODE_INPUT_PLEASE - 招待コードが入力されていない時に表示されます。
|
||||||
INVITATION_CODE_SHIYOUZUMI - 招待コードが使用済みの場合に表示されます。
|
INVITATION_CODE_SHIYOUZUMI - 招待コードが使用済みの場合に表示されます。
|
||||||
|
|||||||
Reference in New Issue
Block a user