1
0
mirror of https://github.com/Daichimarukana/uwuzu.git synced 2026-06-04 19:14:41 +00:00

uwuzu v1.3.4 new_planet

This commit is contained in:
Daichimarukana
2024-03-26 22:48:57 +09:00
parent e0b3b93414
commit ea4ca882da
92 changed files with 3192 additions and 1567 deletions
+22
View File
@@ -0,0 +1,22 @@
<noscript>
<div class="noscript_modal">
<div class="inner">
<div class="oops_icon">⚠️</div>
<h1>JavaScriptを有効にしてください</h1>
<p>uwuzuを開いてくださりありがとうございます。<br>
申し訳ございませんがuwuzuの動作にはJavaScriptが必要です。<br>
JavaScriptを有効にして再読み込みをしてください。</p>
<p>JavaScriptを無効にしている状態での使用はできません。</p>
<p>詳細は下記のリンクよりご確認ください。</p>
<a href="https://uwuzu.com/docs/uwuzusupport" class="infobtn">詳細</a>
<div class="p2">JS_BLOCKED_ERROR</div>
<div class="center_text">
<p><?php echo htmlentities($serversettings["serverinfo"]["server_name"]);?></p>
<p><?php echo $domain;?></p>
<p><?php echo htmlentities($uwuzuinfo[0]);?><br>Version <?php echo htmlentities($uwuzuinfo[1]);?></p>
</div>
</div>
</div>
</noscript>
+12 -34
View File
@@ -19,41 +19,19 @@
for( $i=0;$i<$cnt;$i++ ){
$uwuzuinfo[$i] = ($softwaredata[$i]);
}
function replaceURLsWithLinks_forRightbox($postText) {
$postText = str_replace('&#039;', '\'', $postText);
function replaceURLsWithLinks_forRightbox($postText, $maxLength = 48) {
$pattern = '/(https:\/\/[\w!?\/+\-_~;.,*&@#$%()+|https:\/\/[ぁ-んァ-ヶ一-龠々\w\-\/?=&%.]+)/';
$convertedText = preg_replace_callback($pattern, function($matches) use ($maxLength) {
$link = $matches[0];
if (mb_strlen($link) > $maxLength) {
$truncatedLink = mb_substr($link, 0, $maxLength).'…';
return '<a href="'.$link.'">'.$truncatedLink.'</a>';
} else {
return '<a href="'.$link.'">'.$link.'</a>';
}
}, $postText);
// URLを正規表現を使って検出
$pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現
preg_match_all($pattern, $postText, $matches);
// 検出したURLごとに処理を行う
foreach ($matches[0] as $url) {
// ドメイン部分を抽出
$parsedUrl = parse_url($url);
if (!isset($parsedUrl['path'])) {
$parsedUrl['path'] = '';
}
if (!isset($parsedUrl['query'])) {
$parsedUrl['query'] = '';
}
$nochk_domain = $parsedUrl['host'].$parsedUrl['path'].$parsedUrl['query'];
if(strlen($nochk_domain) > 47){
$domain = mb_substr($nochk_domain, 0, 48, "UTF-8")."...";
}else{
$domain = $nochk_domain;
}
// 不要な文字を削除してaタグを生成
$urlWithoutSpaces = preg_replace('/\s+/', '', $url);
$link = "<a href='$urlWithoutSpaces' target='_blank' title='$urlWithoutSpaces'>$domain</a>";
// URLをドメインのみを表示するaタグで置き換え
$postText = preg_replace('/' . preg_quote($url, '/') . '/', $link, $postText);
}
return $postText;
return $convertedText;
}
?>
<div class="noticearea">