mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-05 03:24:41 +00:00
uwuzu version 1.2.21
This commit is contained in:
+29
-5
@@ -1,6 +1,12 @@
|
||||
<?php
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
|
||||
$banurldomainfile = "../server/banurldomain.txt";
|
||||
$banurl_info = file_get_contents($banurldomainfile);
|
||||
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
@@ -190,9 +196,17 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
$error_message[] = '内容を入力してください。';
|
||||
} else {
|
||||
// 文字数を確認
|
||||
if( 1024 < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は1024文字以内で入力してください。';
|
||||
if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は'.htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8').'文字以内で入力してください。';
|
||||
}
|
||||
|
||||
// 禁止url確認
|
||||
for($i = 0; $i < count($banurl); $i++) {
|
||||
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
|
||||
$error_message[] = '投稿が禁止されているURLが含まれています。';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -554,6 +568,10 @@ if ("serviceWorker" in navigator) {
|
||||
<div id="loading" class="loading" style="display: none;">
|
||||
🤔
|
||||
</div>
|
||||
<div id="error" class="error" style="display: none;">
|
||||
<h1>エラー</h1>
|
||||
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
@@ -606,12 +624,18 @@ $(document).ready(function() {
|
||||
method: 'GET',
|
||||
data: { page: pageNumber, userid: userid },
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -655,10 +679,10 @@ $(document).ready(function() {
|
||||
// いいね成功時の処理
|
||||
if (isLiked) {
|
||||
$this.removeClass('favbtn_after'); // クラスを削除していいねを取り消す
|
||||
$this.find('img').attr('src', '../img/sysimage/favorite_1.svg'); // 画像を元の画像に戻す
|
||||
$this.find('use').attr('xlink:href', '../img/sysimage/favorite_1.svg#favorite'); // 画像を元の画像に戻す
|
||||
} else {
|
||||
$this.addClass('favbtn_after'); // クラスを追加していいねを追加する
|
||||
$this.find('img').attr('src', '../img/sysimage/favorite_2.svg'); // 画像を新しい画像に置き換える
|
||||
$this.find('use').attr('xlink:href', '../img/sysimage/favorite_2.svg#favorite'); // 画像を新しい画像に置き換える
|
||||
}
|
||||
|
||||
var newFavoriteList = response.newFavorite.split(',');
|
||||
|
||||
Reference in New Issue
Block a user